Forums

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

Home Forums JavaScript Adding multiple javascripts in one page

  • This topic is empty.
Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #42393
    edonian
    Participant

    I tried searching in other sites for a solution but I just don’t understand what to do here. I’m hoping someone here can tell me what’s going on and how I can fix this.

    What I’m trying to achieve is the ability to maintain the javascript scroll effect and the pop up video effect. Both scripts seem to clash and one cancels the other. So I’ve linked my site where one script will work.

    [Link #1](http://casildasdesigns.webs.com/testing/help1.htm “Link here”)
    In this link, the javascript scrollbar works within the content page (The entire page doesn’t move, just the left side). The scrollbar isn’t visible so you’ll have to scroll using your mouse wheel or your laptop finger pad. But the trailer will not pop up correctly.

    [Link #2](http://casildasdesigns.webs.com/testing/help2.htm “Link here”) In this link, you cannot scroll… but the video pop up works, just click the red “trailer” link and you’ll see that the video will pop up.

    Again I want my site to have the ability to have both effects. Is this possible? This will help me so much if someone can explain what I’m doing wrong. I’m so not an expert at this stuff. :(

    I’m also having an issue with posting the code so feel free to right click and view source.

    #123018
    edonian
    Participant

    I don’t understand. Do you mean pasting one of the scripts into another javascript file?

    #123027
    edonian
    Participant

    Argh.. I have no idea what I’m doing wrong. I’ve been searching and I believe there is a code to prevent the javascript from clashing but I don’t understand where to place said code.. would it be inside the .js file? or the actual .html page? :/

    #123028
    Paulie_D
    Member

    Personally, I think you (or someone) needs to look at the two JS files and see what the clash is?

    #123030
    edonian
    Participant

    Well it seems when I add these following codes:



    Which are the .js files that allow the video pop up, it cancels the javascript scrollbar. I guess I don’t know how to properly use multiple external javascript files.

    EDIT: Bleh… it’s not allowing me to post the codes. >_<

    #123036
    Paulie_D
    Member

    All you have to do it copy the script text (without any script tags)…and paste it into the box.

    THEN select it all and hit the Quote item on top of the box. It should indent all the text and there you are:

    function retrieveComputedStyle(element, styleProperty)
    {
    var computedStyle = null;

    if (typeof element.currentStyle != “undefined”)
    {
    computedStyle = element.currentStyle;
    }
    else
    {
    computedStyle = document.defaultView.getComputedStyle(element, null);
    }
    return computedStyle[styleProperty];
    }

    See?

    #123043
    edonian
    Participant

    I’m trying to show you the external files not the internal but I’ll give it a try. Testing codes below:

    src=”http://www.freewebs.com/p.js”/script>script src=”/fancybox/1.4-jquery.min.js”/script
    script src=”/fancybox/jquery.-1.3.4.pack.js”/script
    script src=”/fancybox/video.js”/script

    Well if a part of the code shows, hopefully you can see what I’m talking about in the source.

    #123047
    Paulie_D
    Member

    Yeah, but that’s not the point.

    You have two linked JS files fighting/conflicting. The answer is to find what the conflict is and solve it.

    To do that we need to see the JS TEXT for both not the links.

    That said, however, the versions of jQuery I can see being reference as quite old and it’s possible that something has been deprecated.

    #123049
    edonian
    Participant

    Unfortunately, I wouldn’t know what to look for. I’m using codes that was given from a tutorial. And perhaps that’s the reason why it’s not working. I do appreciate your help.

    #123051
    Paulie_D
    Member

    On looking at the source code of the links you gave you have WAY too many js files linked in there all probably old versions trying to do multiple things at the same time and in the wrong order.

    #123063
    edonian
    Participant

    Yeah, I figured that’s what was happening as well. I’ve been rearranging the codes to see if they would work. Do you know if it would work if I updated the jQuery? Or…Do you know if there is a simpler way for me to achieve what I want?

    #123069
    TylerNYC
    Member

    Edonian, give me bit. As soon as my toddlers rest, I will solve this for you!

    #123070
    edonian
    Participant

    Thank you so much! I’ve been trying to figure this out since yesterday… and it’s driving me crazy!

    #123085
    TylerNYC
    Member

    Okay, I’m back.

    Edonian, are you working on your site right now? The sources keep changing.

    #123087
    edonian
    Participant

    I have been trying to figure it out, but I changed it back. Sorry! LOL

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