Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-18-2013, 09:49 AM   PM User | #1
cf_member
New to the CF scene

 
Join Date: Jun 2012
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
cf_member is an unknown quantity at this point
Exclamation My jQuery noConflicts won't work

Hi
I have a problem. I have 4 jquerry effects from my page website.
One for lightbox, one for sliding image btn from right side of
my page, one accordion effects, and one tweets using with jQuery.
Now I've tested on which does my twitter conflicts of the 3 scripts.
Then I found that it is from my lightbox. Now I'm working with lightbox
and tweets that would not be conflict.

In my lightbox, i have this line
Code:
<script type="text/javascript">
	$.noConflict();
	jQuery(document).ready(function($){
    $(function() {
		$('.pasko a').lightBox();
		$('.gallery a').lightBox();
        $('.area a').lightBox();
		$('.picture a').lightBox();
		$('.interior a').lightBox();
		$('.floorplan a').lightBox();
    });
	})(jQuery);	
    </script>
And my tweets is
Code:
<script type='text/javascript'>									
jQuery(function($){
   jQuery(".tweet").tweet({
	avatar_size: 0,
	count: 1,
        username: "neovistahomes",
	template: "{text}  {retweet_action}"
	});
}).bind("loaded", function(){
	jQuery(this).find("a.tweet_action").click(function(ev) {
	window.open(this.href, "Retweet",
																	'menubar=0,resizable=0,width=550,height=420,top=200,left=400');
	ev.preventDefault();
	});
}); 
</script> 
	<div class="tweet"></div>
And now my question is, how do i make that the two scripts would not
be conflict. ? Any suggest or any idea how?

Last edited by cf_member; 02-18-2013 at 09:51 AM..
cf_member is offline   Reply With Quote
Old 02-18-2013, 12:23 PM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,594
Thanks: 5
Thanked 865 Times in 842 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
Well, it seems like you haven’t quite understood the noConflict function. But there is no way to give you a solution to your problem without seeing the entire HTML (i. e. the way how you are including/referencing the scripts). Maybe case two in my carefully written sticky applies to you?
__________________
Don’t click this link!
VIPStephan is online now   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:18 AM.


Advertisement
Log in to turn off these ads.