Thread: jQuery Setting default img src
View Single Post
Old 11-25-2011, 07:17 PM   PM User | #1
jagwebby
New to the CF scene

 
Join Date: Nov 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
jagwebby is an unknown quantity at this point
Setting default img src

Hi,

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.


Code:
	<div id="tabs-1">
    			  <div style="width: 270px; float:left"><!-- Wordpress Popular Posts Plugin v2.1.6 [SC] [daily] [custom] -->

<ol>
<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>
</ol>
<!-- End Wordpress Popular Posts Plugin v2.1.6 -->

    			      			              </div>

    
     <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>


</div>

Last edited by jagwebby; 11-25-2011 at 11:22 PM..
jagwebby is offline   Reply With Quote