Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Dec 2007
Posts: 53
Reputation: rouse is an unknown quantity at this point 
Solved Threads: 1
rouse rouse is offline Offline
Junior Poster in Training

JQuery question

 
0
  #1
Mar 27th, 2009
Two related jQuery questions.
Is there a way in JQuery to slide to a particular point such as slide 10px or slides to a DIV, the parameters passed in the functions are speed and callback.

Second questions:
I was hoping I could filter on a name with a jQuery option so that if I had a list of buttons with the following names.
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <div id="myDiv2" >
  2. <button type="button" name="do1">Try Me!</button>
  3.  
  4. <br />
  5. <button type="button" name="do2">Click Me!</button>
  6.  
  7. <br />
  8. <button type="button" name="do3">Press Me!</button>
  9. </div> <!-- End myDiv2 -->
I could select one with the following example statement:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. view plaincopy to clipboardprint?
  2. <script type="text/javascript">
  3. $(document).ready(function(){
  4. //if a button with a name of 'do1' is selected
  5. $(":button:do1").click(function(){
  6. $("div#myDiv1").hide();
  7. });
  8. });
  9. </script>
Please help me with the grammar to do this.
Thanks!
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 53
Reputation: rouse is an unknown quantity at this point 
Solved Threads: 1
rouse rouse is offline Offline
Junior Poster in Training

Re: JQuery question

 
0
  #2
Mar 27th, 2009
I came up with this for the second question, but still no answer to the first.
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. $(document).ready(function(){
  2. //if a button with a name of 'do1' is selected
  3. $(":button[name='do1']").click(function(){
  4. $("div#myDiv1").hide("slow");
  5. });
Is there another/better solution?
Thanks!
WBR
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC