0

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.

<div id="myDiv2" >   
            <button type="button" name="do1">Try Me!</button>   
               
<br />   
            <button type="button" name="do2">Click Me!</button>   
               
<br />   
            <button type="button" name="do3">Press Me!</button>   
        </div> <!-- End myDiv2 -->

I could select one with the following example statement:

view plaincopy to clipboardprint?
<script type="text/javascript">   
    $(document).ready(function(){   
        //if a button with a name of 'do1' is selected   
       $(":button:do1").click(function(){   
          $("div#myDiv1").hide();   
       });   
    });   
</script>

Please help me with the grammar to do this.
Thanks!

1
Contributor
1
Reply
2
Views
8 Years
Discussion Span
Last Post by rouse
0

I came up with this for the second question, but still no answer to the first.

$(document).ready(function(){   
        //if a button with a name of 'do1' is selected   
        $(":button[name='do1']").click(function(){   
        $("div#myDiv1").hide("slow");   
       });

Is there another/better solution?
Thanks!
WBR

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.