Related Topics


[Video CMS v4]Custom css file on scroll  (Read 606 times) Print

1 B


mihai  June 16, 2015, 03:43:34 PM

Hi i wanna add some content(css codes) for my website but it must be active only one scroll.Pretty much like the backtotop btn.

Logged


mihai  June 17, 2015, 06:18:31 PM

Code
	  jQuery(".customdiv").addClass("customcss");
    jQuery(window).scroll(function () {
        if (jQuery(this).scrollTop() === 0) {
            jQuery(".customdiv").addClass("customcss")
        } else {
            jQuery(".customdiv").removeClass("customcss")
        }
    });

Now customdiv should be my div and i wanted to have customcss on scroll,is this function correct?

Logged


Alexander  June 18, 2015, 04:03:10 PM

Salut Mihai, gasesti foarte multa informatie despre asa ceva pe Google https://www.google.ro/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=making+a+div+show+up+on+scroll
Nu are legatura cu PHPVibe si sincer ma pricep prea putin la javascript ca sa-ti dau o parere iar Mario e super ocupat acum.

Logged

mihai  June 18, 2015, 11:11:58 PM

Multumesc pentru link.m-a ajutat,am rezolvat ce am vrut.

Logged