swdean wrote:
> I am quite new to coding and I am trying to show div in case js is
> disabled
> the reason is because I set it to display: none
> 

You should do it completely otherwise.

Show div always, and hide it if javascript is enabled.

<div class="hideOnLoad">
</div>
<script type="text/javascript">

document.observe('dom:loaded',function() {
/*dom:loaded event is fired by prototype.js
   when all html is loaded and the DOM tree built,
   but not yet all images and css are loaded */

// invoke method .hide() on all elements with class .hideOnLoad
   $$('.hideOnLoad').invoke('hide');
});

</script>

This way the user should not even notice the div is shown on load,
as it will be hidden by javascript before the page is fully rendered.

Please read about "unobtrusive javascript" to learn more about this 
techniques.

-- 
Best Regards,
SWilk




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to