asp.net mvc - JQuery Document.ready functionality flashes at page start-up -
i'm using jquery's document.ready hide things mvc master page. when page loads, though, can see elements i'm removing flash second before disappearing.
this how i'm doing it:
<asp:content id="maincontent" contentplaceholderid="maincontent" runat="server"> <script type="text/javascript"> $(document).ready(function () { $("#hidediv").remove() }); </script>
how can rid of flashing? want elements i'm removing gone before page renders.
update:
i should point out i'm doing dynamically, hiding things on pages. hidediv example name gave, perhaps poor one.
for example, have menu bar @ top has links various pages. want remove link page when user on page. rather manually adding wanted links on each page, have them in master page, , hide ones don't want shown on page.
apparently document.ready not time this? might better way accomplish that?
if hide elements initally using css not shown:
<style type="text/css"> #hidediv { display: none; } </style>
if not possible, can put script tag after element:
<div id="hdediv">...</div> <script type="text/javascript"> $('#hidediv').remove(); </script>
Comments
Post a Comment