Solved

jquery bind in click function?

Posted on 2012-04-08
4
331 Views
Last Modified: 2012-05-09
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
Comment
Question by:Refael
  • 2
  • 2
4 Comments
 

Author Comment

by:Refael
ID: 37821944
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
 
LVL 6

Accepted Solution

by:
jjperezaguinaga earned 500 total points
ID: 37822580
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
 

Author Comment

by:Refael
ID: 37823014
Hi jjperezaguinaga,

It works but ... as i said above the slider seem double bounce/slide.
0
 
LVL 6

Expert Comment

by:jjperezaguinaga
ID: 37823704
Oh, that's weird.

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

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question