html - loading thumbnail and content in div dynamically -
hi want load thumbnails in div2 each menu clicked in div1 .the present code thumbnail show on pageload.it shud show when menu click.and aslo when click thumbnails should show diff display content in div3.how dynamically load div3 each thumbnail clicked diff content(imagage&text). check url layout planingenter link description here
<head> <title>scroll menu</title> <script type="text/javascript" src="../js/jquery-1.3.1.min.js"></script> <script type="text/javascript" src="../js/jquery.easing.1.3.js"></script> <script type="text/javascript" src="../js/jquery.color.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#menu li').click(function () { window.location = $(this).find('a').attr('href'); }).mouseover(function (){ $(this).find('a') .animate( { paddingleft: padleft, paddingright: padright}, { queue:false, duration:100 } ) .animate( { backgroundcolor: colorover }, { queue:false, duration:200 }); }).mouseout(function () { $(this).find('a') .animate( { paddingleft: defpadleft, paddingright: defpadright}, { queue:false, duration:100 } ) .animate( { backgroundcolor: colorout }, { queue:false, duration:200 }); }); $('#sidebar').mousemove(function(e) { var s_top = parseint($('#sidebar').offset().top); var s_bottom = parseint($('#sidebar').height() + s_top); var mheight = parseint($('#menu li').height() * $('#menu li').length); $('#debugging_mouse_axis').html("x axis : " + e.pagex + " | y axis " + e.pagey); $('#debugging_status').html(math.round(((s_top - e.pagey)/100) * mheight / 2)); var top_value = math.round(( (s_top - e.pagey) /100) * mheight / 2); $('#menu').animate({top: top_value}, { queue:false, duration:500}); }); }); </script> <style> body { padding:0; margin:0 20px; } #sidebar { height:400px; overflow:hidden; position:relative; background-color:#fff; } #menu { width:100%; list-style:none; padding:0; margin:0; top:0; position:relative; height:100%; width:300px; } #menu li { padding:10px 0; text-align:right; display:block; cursor:hand; cursor:pointer; } #menu li { background:url() repeat #1f1f1f; color:#ddd; font-family:helvetica, arial, verdana; font-size:9px; font-weight:900; display:inline; padding:20px 8px 5px 20px; text-decoration:none; } #menu li span { font-family:georgia, arial; font-size:9px; color:#464646; } </head> <div id = "mainmenu"> <ul><li><a href="#">menu1</a></li><li><a href="#">menu2</a></li> </ul></div> <div id="sidebar"> <ul id="menu"> <li><a href="#"><img src="img" alt="alt text" /></a></li> <li><a href="#"><img src="" alt="alt text" /></a></li> <li><a href="#"><img src="" alt="alt text" /></a></li> <li><a href="#"><img src="" alt="alt text" /></a></li> <li><a href="#"><img src="" alt="alt text" /></a></li></ul> <ul id="menu"> <li><a href="#"><img src="" alt="alt text" /></a></li> <li><a href="#"><img src="" alt="alt text" /></a></li> <li><a href="#"><img src="" alt="alt text" /></a></li> <li><a href="#"><img src="" alt="alt text" /></a></li><li><a href="#"><img src="" alt="alt text" /></a></li> </ul> </div> <div id ="contentdisplay" <ul><li>content display</li></ul></div> <div style="font-size:12px;color:#ccc"></div> </body> </html>
i think link you
jsfiddle.net/pwqex/
i add 2 div if want add more div @ javascript method
Comments
Post a Comment