Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 337
  • Last Modified:

jquery bind in click function?

Hello Experts,

I am sure the below code is fairly simple.
all i am trying to do is to bind the 1st and the 2nd click events because at the moment the slide (#ausstattungs-container) is showing bouncing  twice.

Please help!


$(document).ready(function() {
	
	$('table tr').click(function() {
		
		var firstTd = $('.tdlight:first', $(this));
		if (firstTd.length == 0)
			return;	
		
		var text = firstTd.text();
		
		$('#sliderClick').click(function() {
		$('#ausstattungs-container').show("slide", { direction: "right" }, 1000);
		$('#we'+text).show();
		});
	});	
});

Open in new window

0
Refael
Asked:
Refael
  • 2
  • 2
1 Solution
 
RefaelAuthor Commented:
This is actually not a bind problem.

this cause the problem

.show("slide", { direction: "right" }, 1000);

Open in new window


When i use
.slideDown();

Open in new window


It works fine!

so how can i use "slide to right "?
0
 
jjperezaguinagaCommented:
Greetings Refael,

Docs are your friend! http://docs.jquery.com/UI/Effects/Slide

Make sure you are using UI and importing the last version of jQuery, since the first line should work :)

As a last resource, you can use the css property margin-left: Xpx with animation, or the css property left, in case your div is position: absolute. I still stand by my statement, pretty sure the code works, you just need to import jQuery UI and the latest version of jQuery.

Cheers!
-JJ
0
 
RefaelAuthor Commented:
Hi jjperezaguinaga,

It works but ... as i said above the slider seem double bounce/slide.
0
 
jjperezaguinagaCommented:
Oh, that's weird.

Can you confirm that your html markup is like the following?
http://jsfiddle.net/yJ72f/
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now