tags:

views:

811

answers:

2

I want to switch image under facebook page's tab (static fbml application) but it doesn't work. Does anyone have any ideas?

This code doesn't work:

<img src="http://www.figleaf.com/Services/images/google-logo.jpg" onmouseover="toggleOn(this)"/>

<script>
    <!--
    function toggleOn(obj)
    {
        obj.src = "http://www.brickmarketingconsulting.com/yahoo.jpg";

    }


    //-->
</script>

This code from a forum post doesn't work too (http://forum.developers.facebook.com/viewtopic.php?pid=66795):

<a href="http://apps.facebook.com/.../index.php/"&gt;
<div id="logo_div" style="background-color:#3B5998">
    <img src="http://www./.../LOGO.jpg" alt="Our Logo" height="55px" onmouseover="document.getElementById('logo_div').setInnerFBML(pic2);"/>
</div>
</a>

<fb:js-string var='pic1'>
      <img src="http://www./.../LOGO.jpg" alt="Our Logo (home)" height="55px" onmouseover="document.getElementById('logo_div').setInnerFBML(pic2);"/>
</fb:js-string>

<fb:js-string var='pic2'>
      <img src="http://www./.../LOGO2.jpg" alt="Our Logo (home)" height="55px" onmouseout="document.getElementById('logo_div').setInnerFBML(pic1);"/>
</fb:js-string>
A: 

obj.src is not supported in fbml app.

instead try using this:

obj.setSrc("http://www.brickmarketingconsulting.com/yahoo.jpg");

http://wiki.developers.facebook.com/index.php/FBJS

Sarfraz
+1  A: 

Let me answer my own question: The onmouseover effect is triggered only after the user clicks on the facebook page's page (Canvas page).

Billy
On pages, walls, and profiles, nothing runs automatically, for obvious reasons. Just look at MySpace to see how bad things could get.
Brent Baisley

related questions