简体   繁体   中英

Adding slide effect by anchor tag

I want to open another searchpage.html html page with slide effects for which i used anchor tag.

<a id="add" href="searchpage.html" class="show_hide">Click</a>

And js:

 $(document).ready(function () {
        $('.show_hide').click(function (e) {
            e.preventDefault(); //to prevent default action of link tag
            $(this).toggle('slide','left',100);
        });
 });

But its showing error:

TypeError: jQuery.easing[this.easing] is not a function

Try this one, this may help You..

HTML :

<a id="add" href="searchpage.html" class="show_hide">Click</a>

JS:

$(document).ready(function () {
    $('.show_hide').click(function (e) {
        e.preventDefault(); //to prevent default action of link tag
        $('#add').slideToggle(1000);
    });
});

And Here is Demo .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM