javascript - slide down menu in html frames -
i want slide down menu in frames in html ,when user clicks on button present in top frame should slide down how can have created frames
<!-- frameset deprecated in html5, still works. --> <frameset framespacing="0" rows="40,*,15" frameborder="1" noresize> <frame name="top" src="http://www.yahoo.com" target="top"></frame> <frame name="main" src="http://www.google.com" target="main"></frame> <frame name="bottom" src="http://www.facebook.com" target="bottom"></frame> </frameset>
my requirement this:
but want implement in frames
frames not valid html5. now, iframes have been introduced. need add button each iframe show onclick. following code buttons , iframe -
<button id ="b1" type="button">click me yahoo!</button> <iframe id="yahoo" src="http://www.yahoo.com"></iframe><br> <button id ="b2" type="button">click me google!</button> <iframe id="google" src="http://www.google.com"></iframe><br> <button id ="b3" type="button">click me facebook!</button> <iframe id="facebook" src="http://www.facebook.com"></iframe><br>
now need make these iframes hide on page load initially. appear on button click.
$(document).ready(function(){ $("#yahoo").hide(); $("#google").hide(); $("#facebook").hide(); $("#b1").click(function(){ $("#yahoo").show(); }); $("#b2").click(function(){ $("#google").show(); }); $("#b3").click(function(){ $("#facebook").show(); }); });
Comments
Post a Comment