Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Why don’t Scripts work together on one page?

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #32725
    tuupur
    Member

    Hi there :P
    I got this problem with my page called Tuupurid(‘Nerds’ in English), that javascripts just don’t work on my page like they shoud to. I got 4 codes: Fancy box gallery in jQuery, menu in jQuery, AJAX and also one script from here, called “Middle Box Links”. Funny thing about it is that some codes just work when they want even if I don’t change the code. So its very weird to me :D
    Here are the codes :
    Front of the codes I got jQuery code –

    Fancybox –




    Menu –

    	

    AJAX –

    Middle box… –

    I hope you can understand my crappy English, because I’m actually from Estonia :)

    #76221
    SgtLegend
    Member

    When i reviewed your page source i found

    var $j = jQuery.noConflict();

    Because its part of the global scope “exampleuudis.js” most likely is still trying to ready $ but can’t because it has been overwritten. Your best bet would be to remove that line and update the .ready() method below it from $j to $

    #76214
    tuupur
    Member

    OKei, Fancybox, AJAX and Menu are working now, but not exampleuudis.js. What should I to there ?

    var $el, $tempDiv, $tempButton, divHeight = 0;
    $.fn.middleBoxButton = function(text, url) {
    return this.hover(function(e) {
    $el = $(this).css("border-color", "white");
    divHeight = $el.height() + parseInt($el.css("padding-top")) + parseInt($el.css("padding-bottom"));
    $tempDiv = $("
    ", {
    "class": "overlay rounded"
    });
    $tempButton = $("", {
    "href": url,
    "text": text,
    "class": "widget-button rounded",
    "css": {
    "top": (divHeight / 2) - 7 + "px"
    }
    }).appendTo($tempDiv);
    $tempDiv.appendTo($el);
    }, function(e) {
    $el = $(this).css("border-color", "#999");
    $(".overlay").fadeOut("fast", function() {
    $(this).remove();
    })
    });
    }
    $(function() {
    $(".widget-six").middleBoxButton("Loe edasi", "http://tuupurid.com/library/arhiiv.php");
    });
    #76205
    tuupur
    Member

    Oh, deam. Scripts don’t work again…(I didn’t do anything :D)

    #75990
    tuupur
    Member

    Does anyone know the answer for this problem ?

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.