Jump to content

How to activate a link on page load? (first thumb in gallery)


Recommended Posts

I have created a scrolling gallery that uses ajax to upload video/images from folders.

The gallery works exept that on page load my gallery main div-->('rightcolumn') is empty

because thumbs must be clicked to show video. Could you please tell me how i could

make the first thumb ("item" ) show automatically on page load so i don't have an empty div?

hvo007.jpg

CODE SAMPLE OF THE THUMB SECTION:

...

<!-- root element for scrollable -->

<div class="scrollable vertical">

 

<!-- START root element for the items -->

<div class="items" >

    <!-- start scroll distance -->

<div>

 

 

          <div class="item">

          <a href="javascript:ajaxpage('ajaxfiles/external.xml', 'rightcolumn');" class="borderless" id="go">

          <img src="images/AliG.jpg" width="55" height="50">

          <p class="paragraph">

        YOUTUBE EMBED GOOD</p>

          </a>

          </div>

         

         

          <div class="item">

          <a href="javascript:ajaxpage('ajaxfiles/external3.htm', 'rightcolumn');" class="borderless">

          <img src="images/AliG.jpg" width="55" height="50">

          <p style="width:130px; margin-left:70px; margin-top:-54px; float:right;">

        VBS>TV TEST</p>

          </a>

          </div>

         

          <div class="item">

          <a href="javascript:ajaxpage('ajaxfiles/onion1.xml', 'rightcolumn');" class="borderless">

          <img src="images/AliG.jpg" width="55" height="50">

          <p style="width:130px; margin-left:70px; margin-top:-54px; float:right;">

        ONION TEST</p>

          </a>

          </div>

...

I have tried using some query:

<script type="javascript">

$(document).ready(function()

{

$("go").trigger('click');

});

</script>

 

idea from jquery api info:http://api.jquery.com/trigger#eventdata

 

And tried with :

<script type="text/javascript">

window.onload.getElementById('go').click();

</script>

 

..not working

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.