SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Apr 2010
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I think i have jquery conflict problem help please

    Hi i have a site which a use a slideshow which has its own js files to work and a jquery tabs which also has its own js files, but now since i had both those src files into the head of my page only one works, it seems i cant have both src files.

    I have googled about the jquery conflict function but i just dont think i can get the sintax correct can someone help me out please? thanks in advance
    I've separated the files with html coment ofr better visual the files i need are SLIDESHOW files, and TABS file.

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>People Smart Learning</title>
    <link rel="stylesheet" type="text/css" href="stylesheets/main.css" />
    <link rel='stylesheet' id='style-css'  href='slide-show/diapo.css' type='text/css' media='all'>
    <link type="text/css" href="js/jquery-ui-1.8.18.custom.css" rel="stylesheet" />	
    <meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE" />
    
    <!-- START SLIDESHOW FILES  -->
    <script type='text/javascript' src='slide-show/scripts/jquery.min.js'></script>
    <!--[if !IE]><!--><script type='text/javascript' src='slide-show/scripts/jquery.mobile-1.0rc2.customized.min.js'></script><!--<![endif]-->
    <script type='text/javascript' src='slide-show/scripts/jquery.easing.1.3.js'></script>
    <script type='text/javascript' src='slide-show/scripts/jquery.hoverIntent.minified.js'></script> 
    <script type='text/javascript' src='slide-show/scripts/diapo.js'></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.0/mootools-yui-compressed.js"></script>
    <script>
    	$(function(){
    		$('.pix_diapo').diapo();
    	});
    </script>
    <!-- END SLIDESHOW FILES FOR  -->
    
    
    <!-- START CONTACT FORM FILES -->
    <script type="text/javascript" src="form/validation/validation.js"></script>
     <script type="text/javascript">
    		var nameError = '<?php echo $error_messages['fullname']; ?>';
    		var emailError = '<?php echo $error_messages['email']; ?>';
    		var telephoneError = '<?php echo $error_messages['telephone']; ?>';
    		var commentError = '<?php echo $error_messages['comment']; ?>';
    	</script> 
    <!-- START CONTACT FORM FILES -->
    
    
    <!--START TAB FILES-->
    <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script>
    <script type="text/javascript">
    	$(function(){
    		// Tabs
    		$('#tabs').tabs();
    	});
    </script>
    <!-- END TABS FILES -->
    
    </head>

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,682
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by macaela View Post
    I have googled about the jquery conflict function but i just dont think i can get the sintax correct can someone help me out please? thanks in advance
    Here's a good summary on how to use jQuery's noConfict
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,139
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)
    I truly believe that loading different versions of the same library points to a dramatic flaw in decisions that have been made. There isn't any type of sacrifice which can be made to only load a single version of library. I mean… perhaps a plugin is better in one version is "better" than another but it is probably a small price to pay than having to load jQuery multiple times. Not to mention using Mootools on top of it. You can't tell me that a plugin doesn't exist for what is being done in mootools which can't be done with jQuery or some plugin. I wouldn't believe it.
    The only code I hate more than my own is everyone else's.

  4. #4
    SitePoint Addict
    Join Date
    Apr 2010
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi thank you all for the help 1st i tried the conflict it almost work but just some of the function on the slideshow not fully working this how i set up please let me know if that how is done? I put the (<script>jQuery.noConflict();</script>) under the tabs files and then add the ( jQuery.noConflict() in the end of all the files but didnt quite work has some of the slide function not working am i doing the right way?
    Hi oddz i tried to just have one library but that only work one function and the other didnt work. if you know how can i set the library that will make both function work please help me thanks in advance
    HTML Code:
    <!-- START SLIDESHOW FILES  -->
    <script type='text/javascript' src='slide-show/scripts/jquery.min.js'></script>
    <!--[if !IE]><!--><script type='text/javascript' src='slide-show/scripts/jquery.mobile-1.0rc2.customized.min.js'></script><!--<![endif]-->
    <script type='text/javascript' src='slide-show/scripts/jquery.easing.1.3.js'></script>
    <script type='text/javascript' src='slide-show/scripts/jquery.hoverIntent.minified.js'></script> 
    <script type='text/javascript' src='slide-show/scripts/diapo.js'></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.0/mootools-yui-compressed.js"></script>
    <script>
    	$(function(){
    		$('.pix_diapo').diapo();
    	});
    </script>
    <!-- END SLIDESHOW FILES FOR  -->
    
    
    <!-- START CONTACT FORM FILES -->
    <script type="text/javascript" src="form/validation/validation.js"></script>
     <script type="text/javascript">
    		var nameError = '<?php echo $error_messages['fullname']; ?>';
    		var emailError = '<?php echo $error_messages['email']; ?>';
    		var telephoneError = '<?php echo $error_messages['telephone']; ?>';
    		var commentError = '<?php echo $error_messages['comment']; ?>';
    	</script> 
    <!-- START CONTACT FORM FILES -->
    
    
    <!--START TAB FILES-->
    <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script>
    <script>jQuery.noConflict();</script>
    
    <script type="text/javascript">
    
    </script>
    <!-- END TABS FILES -->
    
    <script type="text/javascript">
    	jQuery.noConflict();
    	jQuery(function ($) {
    				$('#tabs').tabs();
    
    	});
    </script>


Bookmarks

Posting Permissions

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