• Resolved smit_ralph

    (@smit_ralph)


    Hi, thanx for your great plugin.

    A question though: is there anyway I could alter the code somewhere to have the widget show folded out on a specific page? I would like the widget to allready be shown on my homepage, and hidden (the normal behavior) on all the other pages…

    I hope you have a suggestion for me how to get this working.

    thx,

    Ralph

    http://wordpress.org/plugins/sliding-widgets/

Viewing 1 replies (of 1 total)
  • Thread Starter smit_ralph

    (@smit_ralph)

    Nevermind. I managed to do this by adjusting the Javascript in the Left.php file.
    It now recognizes the frontpage by class and then automatically folds out widget. Her’s the code:

    var wpssclose_ = 0;
    	if ($('body').hasClass('home')) {
    		jQuery('#wpbs_slider').animate({
       	      	     left: '+=<?php echo $width;?>'
           	        }, 400, function() {
               	     // Animation complete.
           	        });
    		wpssclose_ = 1;
    	  }
    
              jQuery('#icon_label').click(function() {
                   if(wpssclose_==1) {
                        jQuery('#wpbs_slider').animate({
                            left: '-=<?php echo $width;?>'
                        }, 400, function() {
                            // Animation complete.
                        });
                        wpssclose_ = 0;
                   } else {
                        jQuery('#wpbs_slider').animate({
                             left: '+=<?php echo $width;?>'
                        }, 400, function() {
                              // Animation complete.
                        });
    		    wpssclose_ = 1;
                   }
          });

    You can see it working here:

Viewing 1 replies (of 1 total)

The topic ‘Automatic fold-out on specific page?’ is closed to new replies.