Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Nov 2011
    Thanked 0 Times in 0 Posts

    Setting default img src


    I am using a wordpress plugin which dynamically generates a thumnail url for a post.

    I am displaying the top 9 posts(top 3 daily, top 3 weekly, and top 3 monthly) on my homepage along with their thumbnails. Each of the top three lists have their own tab that dynamically displays them when you click on the tab.

    When someone mouses over the link to the post I have the thumbnail to the right of the link dynamically change to be that link's thumbnail.

    The problem is when the page loads, the img src for the thumbnail is blank because it has not been set by a onmouseover event yet. What I need is javascript that grabs the second part of the setpage event shown in the code below and inserts it into the img src field in the bottom div when the page loads. I need it so the javascript only grabs the second value from the setpage event of the first post because I want the default thumbnail to be the thumbnail from the first post.

    Here is the code I have for the top 3 daily posts.

    	<div id="tabs-1">
        			  <div style="width: 270px; float:left"><!-- Wordpress Popular Posts Plugin v2.1.6 [SC] [daily] [custom] -->
    <li><a id="one" href="http://link.com" title="Wowie" onMouseOver="setpage('thumb3', 'http://www.google.com', 'http://www.google.com/picture.jpg')"><span class="wpp-post-title">Wowie</span></a> <span class="wpp-post-time">( )</span></li>
    <li><a id="one" href="http://www.google.com/" title="Bow wow" onMouseOver="setpage('thumb3', 'http://www.google.com', 'http://www.google.com/04.jpg')"><span class="wpp-post-title">Bow wow</span></a> <span class="wpp-post-time">( )</span></li>
    <!-- End Wordpress Popular Posts Plugin v2.1.6 -->
         <div style="width:180px; float:right; text-align:center; font-size:12px; color:blue"><a class="clicktoplay" href="#" onClick="gotopage(); return false;"><img src="" border="1" width="180" id="thumb1" />Click To Play</a></div>
    Last edited by jagwebby; 11-26-2011 at 12:22 AM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts