Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74020

Wordpress sliding drawer plugin doesn't stay closed after converting page to HTML

$
0
0

I'm using this plugin: http://wordpress.org/plugins/wordpress-sliding-drawer-content-area/ on my Wordpress site that creates a drawer on the side for my widgets. It works perfectly fine on my local server.

Unfortunately, I have to convert each of the Wordpress pages into HTML pages for use on my client's intranet servers. That's when the drawer refuses to stay closed on page load unlike before.

Here's the js:

jQuery(document).ready(function() {
   if(jQuery('#sod-drawer-plugin.left').length >0){
            var $handle = jQuery('#sod-drawer-plugin.left #sod-drawer-handle');
            var $plugin = jQuery('#sod-drawer-plugin.left');
            var $adjustment = (parseInt($handle.outerWidth())/2)-parseInt($handle.outerHeight())/2;
            if (jQuery.browser.msie){
                $plugin.css({
                        left:parseInt($plugin.css('left'),10) == 0 ? -$plugin.outerWidth():0
                });
                $handle.css({
                        left:parseInt($plugin.css('left'),10) == 0 ? parseInt($plugin.outerWidth()-$adjustment):$plugin.outerWidth()
                });
                $handle.click(function(){
                    $plugin.animate({
                        left:parseInt($plugin.css('left'),10) == 0 ? -$plugin.outerWidth():0
                    });
                    $handle.animate({
                        left:parseInt($plugin.css('left'),10) == 0 ? parseInt($plugin.outerWidth()-$adjustment):$plugin.outerWidth()
                    });
                });
            }else{
                $plugin.css({
                        left:parseInt($plugin.css('left'),10) == 0 ? -$plugin.outerWidth():0
                });
                $handle.css({
                        left:parseInt($plugin.css('left'),10) == 0 ? parseInt($plugin.outerWidth()-$adjustment):$plugin.outerWidth()-$adjustment
                });
                $handle.click(function(){
                    $plugin.animate({
                        left:parseInt($plugin.css('left'),10) == 0 ? -$plugin.outerWidth():0
                    });
                    $handle.animate({
                        left:parseInt($plugin.css('left'),10) == 0 ? parseInt($plugin.outerWidth()-$adjustment):$plugin.outerWidth()-$adjustment
                    });
                });
            }
   }
 });

And the HTML:

<!DOCTYPE html>
<!-- saved from url=(0088)./work-life-balance/enhance-your-professional-standing/ -->
<html lang="en-US"><!--<![endif]--><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8">
    <title>Enhance Your Professional Standing | Staff Benefits and Work-life Initiatives</title>

<link rel="stylesheet" id="sod_drawer_css-css" href="./style(1).css" type="text/css" media="all">
<script type="text/javascript" src="./jquery.js"></script>
<script type="text/javascript" src="./sod_drawer.js"></script>
<link rel="stylesheet" type="text/css" href="./saved_resource.css">
<link rel="stylesheet" type="text/css" media="all" href="./style.css">

</head>
<body class="page page-id-167 page-child parent-pageid-4 page-template-default">

    <div class="sod-drawer left" id="sod-drawer-plugin" style="left: -280px;"> <!--- This value changes to left:0px when loaded on the browser --->
        <div id="sod-drawer-handle" class="pull black rotate" style="left: 240px;">
            <div class="tag"><p>Contents</p></div>
        </div>
        <div class="content">
            <div class="sod-drawer-inner">
                <div class="full" id="sod-drawer-1">
                    <div id="execphp-2" class="sod-drawer-widget widget_execphp">           
                        <div class="execphpwidget">
                            <div id="sidebar">
                                <h1><a href="./" title="Staff Benefits and Work-life Initiatives" rel="home">Staff Benefits and Work-life Initiatives</a></h1>
                                <div id="access" role="navigation" class="desc">
                                    <div class="menu-main-menu-container">
                                        <ul id="menu-main-menu" class="menu">
                                            <li id="menu-item-33" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-33"><a href="./">Introduction</a>
                                            </li>
                                            <li id="menu-item-626" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-626"><a href="./epilogue/">Epilogue</a></li>
                                        </ul>
                                    </div>
                                </div><!-- #access -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</body>
</html>

I'm not proficient with Javascript so a little explanation would be greatly appreciated :)


Viewing all articles
Browse latest Browse all 74020

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>