Jump to content

prototype, div and onload


thewooleymammoth

Recommended Posts

Im using prototype and scriptaculous, I would like to have a div fade in on load... cant figure out how to do it.

 

someone on a nother forum i searched came up with this suggestion using jquery

  1.

      $("#divid").load(function() {

  2.

        alert("The div has been loaded.");

  3.

      });

can this be done somehow with prototype?

Link to comment
Share on other sites

 

can this be done somehow with prototype?

 

here is an example of prototype + scriptaculous

<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js"></script>
<script type="text/javascript" src="js/effects.js"></script>

<script type="text/javascript">
document.observe("dom:loaded", function() {
$("fadein").appear({ duration: 3.0 });
});
</script>


<div id="fadein" style="display:none">
This content is hidden when the page loads
</div>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.