oli22 Posted March 26, 2011 Share Posted March 26, 2011 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? 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 Quote Link to comment https://forums.phpfreaks.com/topic/231817-how-to-activate-a-link-on-page-load-first-thumb-in-gallery/ Share on other sites More sharing options...
sunfighter Posted March 27, 2011 Share Posted March 27, 2011 oli this should work. It worked ok for me. Check your path to the pictures. Quote Link to comment https://forums.phpfreaks.com/topic/231817-how-to-activate-a-link-on-page-load-first-thumb-in-gallery/#findComment-1192883 Share on other sites More sharing options...
oli22 Posted March 28, 2011 Author Share Posted March 28, 2011 My pics show up fine when clicked... i really don't understand your reply, are you serious? What are you talking about? Quote Link to comment https://forums.phpfreaks.com/topic/231817-how-to-activate-a-link-on-page-load-first-thumb-in-gallery/#findComment-1193133 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.