Syntax for sending background image to toggle function
The AL - March 14, 2008 - 20:27
| Project: | Four Seasons |
| Version: | 5.x-1.8 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
No dice. What does it require?

#1
Sorry:
<a href="#" style="background-color:#FF9900;" onclick="toggle_style(\'#FF9900\',\'/img/headerimg.jpg\');"></a>#2
I'm not a cryptologist. I have absolutely no idea what you are talking about.
Try to describe the problem and ask a specific question. It seems a jquery related question. What are you trying to accieve? What is the expected behaviour? Try to add a please ;-)
#3
For this theme, in the template file, there is a small function for toggling between the different colors and font sizes. For the background image of the banner, I want to send that to the function along with color. I just need to know the specific syntax for doing that.
My first post was meant to read "I tried *code example*. No Dice. What does it require?" But the code was filtered out, so I made the reply with the code. That code doesn't throw any browser or Drupal errors, but it doesn't work.
#4
Ok, its seems i have to use my decryptic powers however. Consider the following: you are asking someone, who
So back to business, mr wolf: urbandictionary.com gives the following explanation for "no dice"
There are other explanations, but however i think i got it (http://www.urbandictionary.com/define.php?term=no+dice).
If you take a look at the function it takes ONE variable "color"
function toggle_style(color) {$("#header-image").css("background-color", color);
$("#header-image").css("background-image", "none");
$("h1").css("color", color);
$("h2").css("color", color);
$("h3").css("color", color);
$("#headline a").css("color", color);
}
So you cannot "send" the image to the function. Well, you can but nothing will happen, but you could write your own function. These 2 sites may help you in understanding how jquery works.
http://jquery.bassistance.de/api-browser/
http://docs.jquery.com/Tutorials:How_to_Get_Anything_You_Want
Without "please", no dice that i do it for you. ;-)
#5
Okaaaaaaaaaaaaaay. *cough* I'll just rewrite the function myself. ;-)