www.webdeveloper.com
Results 1 to 3 of 3

Thread: Two jQuery scripts conflicting with each other...

  1. #1
    Join Date
    Dec 2012
    Posts
    81

    Two jQuery scripts conflicting with each other...

    I am having issues with two different jQuery scripts running on the page at the same time. I have a carousel at the top of the page. I also have this Modal window, which works great, until I put it on my website. I have customized the modal window, and here’s a picture of what happens when I run it on my site.

    https://www.box.com/s/b725gr7nxqhmwq7mfumt

    Here is what's currently in the head of my page.

    Code:
    <head>
    
    <meta name="keywords" content="ar toolbox, toolbox, jared newnam, start date calendar, online application, tracker, staff common, compliance, open ended questions, graduation calculator, grad calculator, gpa calculator, crabwa"/>
    <meta name="description" content="Complete SignNow walkthrough for the iPad. " />
    
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>AR's Toolbox - Home</title>
    <meta name="keywords" content="ar toolbox, walkthrough, financial aid, signnow, pin, online appllication center, oac, efc calculator, grad calculator, gpa calculator," />
    <meta name="description" content="Numerous tools used for making the day of an AR much better and more efficient." />
    <link href="css/south_style.css" rel="stylesheet" type="text/css" />
    
    <script type="text/javascript" src="js/jquery-1-4-2.min.js"></script>
    <!--<script type="text/javascript" src="/jqueryui/js/jquery-ui-1.7.2.custom.min.js"></script>-->
    <script type="text/javascript" src="js/jquery-ui.min.js"></script> 
    <script type="text/javascript" src="js/showhide.js"></script> 
    <script type="text/JavaScript" src="js/jquery.mousewheel.js"></script>
    <script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/efccalc.js"></script>
    <script type="text/javascript" src="js/ddsmoothmenu.js"></script>
    
    <link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />
    <link href="SpryAssets/SpryTooltip.css" rel="stylesheet" type="text/css" />

    Here's the JQUERY scripting I'm using...

    Code:
    <!--Modal Code-->
    <script type="text/javascript">
    
    $(function(){
    
        //get the height and width of the page
        var window_width = $(window).width();
        var window_height = $(window).height();
    
        //vertical and horizontal centering of modal window(s)
        /*we will use each function so if we have more then 1
        modal window we center them all*/
        $('.modal_window').each(function(){
    
            //get the height and width of the modal
            var modal_height = $(this).outerHeight();
            var modal_width = $(this).outerWidth();
    
            //calculate top and left offset needed for centering
            var top = (window_height-modal_height)/2;
            var left = (window_width-modal_width)/2;
    
            //apply new top and left css values
            $(this).css({'top' : top , 'left' : left});
    
        });
    
            $('.activate_modal').click(function(){
    
                  //get the id of the modal window stored in the name of the activating element
                  var modal_id = $(this).attr('name');
    
                  //use the function to show it
                  show_modal(modal_id);
    
            });
    
            $('.close_modal').click(function(){
    
                //use the function to close it
                close_modal();
    
            });
    
        });
    
        //THE FUNCTIONS
    
        function close_modal(){
    
            //hide the mask
            $('#mask').fadeOut(500);
    
            //hide modal window(s)
            $('.modal_window').fadeOut(500);
    
        }
        function show_modal(modal_id){
    
            //set display to block and opacity to 0 so we can use fadeTo
            $('#mask').css({ 'display' : 'block', opacity : 0});
    
            //fade in the mask to opacity 0.8
            $('#mask').fadeTo(500,0.8);
    
             //show the modal window
            $('#'+modal_id).fadeIn(500);
    
        }
    </script>
    Also, the above picture shows how everything looks in Chrome. Here's a picture of how the overlay looks when used in IE8. Any ideas on fixing this, too...

    https://www.box.com/s/99f6ydk2qigfwprfu7zb

    Additionally, here's the code I'm using in the <body></body> tags (if it helps)...

    Code:
    <!--Code for Modal overlay-->
        <div id='mask' class='close_modal'></div>
    
        <div id='first_window' class='modal_window' align="center"><h3>Please select the toolbox you would like to enter...</h3><br /><img src="images/toolbox.png" width="96" height="69" alt=""/><br>
        <a href="http://lipsum.com" target="_self" </a><img src="images/View-the-toolbox-for-Admissions.png" width="500" height="96" alt="" /><br /><br> 
        <a href="http://lipsum.com" target="_self" </a><img src="images/View-the-toolbox-for-Academics.png" width="500" height="96" alt="" /><br /><br>
        <a href="http://lipsum.com" target="_self" </a><img src="images/View-the-toolbox-for-Finance.png" width="500" height="96" alt="" /><br />
     </div>
    <!--End Code for Modal overlay-->
    And here is the CSS used (again... if it helps)...

    Code:
    /* leanModal */
    
    #mask{
     position:fixed; /* important */
        top:0px; /* start from top */
        left:0px; /* start from left */
        height:100%; /* cover the whole page */
        width:100%;  /* cover the whole page */
        display:none; /* don't show it '*/
        /* styling bellow */
        background-color: #fb991a; 
    }
    .modal_window{
     position:absolute; /* important so we can position it on center later */
        display:none; /* don't show it */
        /* styling bellow */
        color:white;
    }
    /* style a specific modal window  */
    #modal_window{
     padding:50px;
        border:none;
        background: #fb991a;
        color:black;
    }
    I've done everything I can think of up to this point. Really need some guidance here.

    Thanks, in advance, for your assistance.

    -Jared

  2. #2
    Join Date
    Jan 2011
    Location
    United Kingdom, London
    Posts
    117
    Code:
    <script type="text/javascript" src="js/jquery-1-4-2.min.js"></script>
    <!--<script type="text/javascript" src="/jqueryui/js/jquery-ui-1.7.2.custom.min.js"></script>-->
    <script type="text/javascript" src="js/jquery-ui.min.js"></script> 
    <script type="text/javascript" src="js/showhide.js"></script> 
    <script type="text/JavaScript" src="js/jquery.mousewheel.js"></script>
    <script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/efccalc.js"></script>
    <script type="text/javascript" src="js/ddsmoothmenu.js"></script>
    Why in the world are you loading same library 3 times and in different version, ofcourse they will overwrite each other and cause problems. Put 1.9.1 on top, remove rest and get a start from there
    Javascript, jQuery / Prototype & PHP expert ready to complete your work on Freelancer.co.uk - Hire Me at https://www.freelancer.co.uk/users/1...&action=hireme

  3. #3
    Join Date
    Dec 2012
    Posts
    81
    Hi Maurycy,

    I've done exactly as you've suggested and this is what I've ended up with, so I back-tracked for now and I'm trying to figure out another solution. Any thoughts?

    When I do it like this, it almost seems like it's not using the js/jquery-1.9.1.min.js file...

    Not sure what to make of it...

    Here's what I see now...
    https://www.box.com/s/258b9uck0p883cminf1q

    Here's what the script list in the header looks like...

    Code:
    <link href="css/south_style.css" rel="stylesheet" type="text/css" />
    
    <script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui.min.js"></script> 
    <script type="text/javascript" src="js/showhide.js"></script> 
    <script type="text/JavaScript" src="js/jquery.mousewheel.js"></script>
    <script type="text/javascript" src="js/efccalc.js"></script>
    <script type="text/javascript" src="js/ddsmoothmenu.js"></script>
    
    <link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />
    <link href="SpryAssets/SpryTooltip.css" rel="stylesheet" type="text/css" />
    
    <style  type="text/css" media="screen"> 
    	ul  li{ 
    	  list-style-type:none; 
    	}
    </style>
    Any thoughts here?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center

"

"

X vBulletin 4.2.2 Debug Information

  • Page Generation 0.13301 seconds
  • Memory Usage 2,882KB
  • Queries Executed 15 (?)
More Information
Template Usage (33):
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (6)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (3)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (71):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates