Javascript and Style problems

Koiuy

New Member
I've been looking around everywhere to no avail, I recently changed all of my inline styling to a separate stylesheet, since I have done this I am unable to use a few of my javascript functions. EDIT: The \[code\]left_sidebar\[/code\] and \[code\]right_sidebar\[/code\] won't slide when using the javascript sliding functions as they used to. This starting happening since I moved the styling.Index.php\[code\]<div id = "right_sidebar"> <div id = "right_slide"> <img src = "http://stackoverflow.com/questions/15514035/rightslider.jpg" width = 25px height = 265px onclick = "slide('right_sidebar', 'right');" /> </div> <div id = "notifications" align = center></div> <div id = "friends" align = center> <?php show_friends($db); ?> </div></div> <div id = "left_sidebar"> <div id = "left_slide"> <img src = "http://stackoverflow.com/questions/15514035/profileslider.jpg" width = 25px height = 265px onclick = "slide('left_sidebar', 'left');" /> </div> <div id = "avatar" align = center> <?php display_avatar($username, $ID, 150, 150, $db); ?> </div> </div>\[/code\]Style.css\[code\]#right_slide{ height: 100%; width: 25px; float: left;}#notifications{ height: 150px; overflow-y: scroll;}.friend_button{ height: 50px; width: 150px;}#left_sidebar{ word-wrap: break-word; width: 180px; height: 100%; left: -155px; position: fixed; background-color: white;}#left_slide{ height: 100%; width: 25px; float: right;}#avatar{ margin-top: 10px;}\[/code\]Javascript.js\[code\]function slide(div_id, direction){ var div = document.getElementById(div_id); if(direction == "right"){ if(parseInt(div.style.right) == 0){ lslide_in(div_id); } else{ lslide_out(div_id); notification_refresh(); } } else if(direction == "left"){ if(parseInt(div.style.left) == 0){ rslide_in(div_id); } else{ rslide_out(div_id); } }}function rslide_out(div_id){ var div = document.getElementById(div_id); var stop = 0; if(parseInt(div.style.left) < stop){ div.style.left = parseInt(div.style.left)+5+"px"; setTimeout(function(){rslide_out(div_id);}, 1); }} function rslide_in(div_id){ var div = document.getElementById(div_id); var stop = -155; if(parseInt(div.style.left) >= stop){ div.style.left = parseInt(div.style.left)-5+"px"; setTimeout(function(){rslide_in(div_id);}, 1); }}function lslide_out(div_id){ var div = document.getElementById(div_id); var stop = 0; if(parseInt(div.style.right) < stop){ div.style.right = parseInt(div.style.right)+5+"px"; setTimeout(function(){lslide_out(div_id);}, 1); }} function lslide_in(div_id){ var div = document.getElementById(div_id); var stop = -150; if(parseInt(div.style.right) >= stop){ div.style.right = parseInt(div.style.right)-5+"px"; setTimeout(function(){lslide_in(div_id);}, 1); }}\[/code\]
 
Back
Top