javascript - ImageButton closing div -
this code :
<div runat="server" class="slide"> <img src="images/picto_detail.gif" onclick='<%# eval("campagnerappelid","hideshow(\"details{0}\")")%>' /> <div id='details<%# eval("campagnerappelid")%>' style="display: none;"> <asp:imagebutton runat="server" id="downloadpdf" imageurl="~/images/download.png" /> </div>
the js "hideshow(div)" simple function :
function hideshow(which) { if (document.getelementbyid(which).style.display == "none") document.getelementbyid(which).style.display = 'block'; else document.getelementbyid(which).style.display = "none" }
but have problem asp:imagebutton. when click on it, have code behind download file user computer, when button clicked, div "details" closed display:none... , not able find why.
edit : tested :
window.onload = function () { document.getelementbyid("downloadpdf").onclick = function (e) { if (e && e.stoppropagation && somecriteriatostopbubbling === true) { e.stoppropagation(); } else if (somecriteriatostopbubbling === true) { e = window.event; e.cancelbubble = true; } } };
thanks help.
this how can utilize image hide , show div:
<script type="text/javascript"> $(function(){ $('#close').live('click',function(){ $('#main').show(); $('#login').hide(); }); }); </script> <div style="float:right;"><a id="close">close <img src="assets/close.png" /></a></div>
javascript c# html css
No comments:
Post a Comment