Jump to content

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


oli22

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.