jquery flip plugin show and hide content -
actually not programmer, designer...many reply case.....
i have difficulties applying show , hide content on flip plugin.....
var init = function(){ $("#fliptop").click(function(e){ $("#flipbox").flip({ dir: "top", endcolor: "white", duration:777, onend: function(){ $("#flipbox").html(top); $("#flipbox").css(); } }); }); $("#flipright").click(function(e){ $("#flipbox").flip({ dir: "right", endcolor: "yellow", duration:777, onend: function(){ $("#flipbox").html("right"); $("#flipbox").css({ color: "red", background: "yellow" }); } }); }); $("#flipleft").click(function(e){ $("#flipbox").flip({ dir: "left", endcolor: "blue", duration:777, onend: function(){ $("#flipbox").html("left"); $("#flipbox").css({ color: "white", background: "blue" }); } }); }); $("#flipbottom").click(function(e){ $("#flipbox").flip({ dir: "bottom", endcolor: "red", duration:777, onend: function(){ $("#flipbox").html("bottom"); $("#flipbox").css({ color: "yellow", background: "red" }); } }); }); } $(document).ready(init);
=================================================================================================== thought above javascript redundant...it must simplified in order change show , hide content selected
and here html tried make.......
<ul id="navigation" > <li class="selected"> <a href="#" id="top" rel="white" rev="777"> top </a></li> <li><a href="#" id="right" rel="yellow" rev="777"> right </a></li> <li><a href="#" id="left" rel="blue" rev="777"> left </a></li> <li><a href="#" id="bottom" rel="red" rev="777"> bottom </a></li> </ul> <div id="container"> <div id="flipbox" class="top"> top </div> <div id="flipbox"class="right"> right </div> <div id="flipbox"class="left"> left </div> <div id="flipbox"class="bottom"> bottom </div> </div>
==========================================================================================
then try compile java script command didnt work.... :(
$('document').ready(function(){ $('#flipbox').flip(); $('#navigation li a').each(function(){ $(this).click(function(){ $('#navigation li').each(function(){ $(this).removeclass('selected'); }); $(this).parent().addclass('selected'); var flipid=$(this).attr('id').substr(4); $('#flipbox').flip({ dir: $this.attr("id"), endcolor: $this.attr("rel"), duration:$this.attr("rev"), onend: function(){ }, flipid, 1); return false; }); }); });
what want ask how make works show , hide content after flip effect while clicking on tab navigation......thanks lot response problemmmm
view source-code of page http://lab.smashup.it/flip/ might understand, have never tried flip plugin yet willing you.!!
Comments
Post a Comment