That's because an empty (or for that matter, non-empty) href attribute will
make the browser go to the page it links to - in the case of an empty href,
itself - that measn, it'll reload the page when you click it (after running
your onclick)

This can be remedied by making the onclick function return false:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
    <head>
        <title>Signin</title>
        <script src="http://code.jquery.com/jquery-latest.js";></script>
        <script type="text/javascript"
src="./Resources/UI/effects.core.js"></script>
        <script type="text/javascript"
src="./Resources/UI/effects.slide.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $('#jform').show('slide', {direction:"down"},1000);
                $('a#signin').click(function() {
                    $('#jform').hide('slide', {direction:"down"},1000);
                    return false;
                });
            });
        </script>
    </head>
    <body>
        <div id="jform">
            <a href="" id="signin">Sign in</a>
        </div>
    </body>
</html>


On Tue, Nov 25, 2008 at 5:49 PM, Bruno75 <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> I try to use jquery ui hide effect  slide but it don't work after a
> click on <a href="" >sign in</a>
> it is ok if you delete the href. here is the code
>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
> www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml";>
> <head>
>        <title>Signin</title>
>        <title>Signin</title>
>        <script src="http://code.jquery.com/jquery-latest.js";></script>
>        <script type="text/javascript" src="./Resources/UI/
> effects.core.js"></script>
>    <script type="text/javascript" src="./Resources/UI/
> effects.slide.js"></script>
>        <script type="text/javascript">
>                $(document).ready(function() {
>                    $('#jform').show('slide', {direction:"down"},1000);
>                $('a#signin').click(function() {
>                        $('#jform').hide('slide', {direction:"down"},1000);
>                });
>                });
>        </script>
> </head>
>
> <body>
>
>        <div id="jform">
>                <a href="" id="signin">Sign in</a>
>        </div>
>
> </body>
> </html>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to