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
Description

I tried:

No dice. What does it require?

#1

The AL - March 14, 2008 - 20:28

Sorry:
<a href="#" style="background-color:#FF9900;" onclick="toggle_style(\'#FF9900\',\'/img/headerimg.jpg\');"></a>

#2

derjochenmeyer - March 14, 2008 - 22:39

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

The AL - March 15, 2008 - 02:52

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

derjochenmeyer - March 16, 2008 - 11:56

Ok, its seems i have to use my decryptic powers however. Consider the following: you are asking someone, who

  • is doing this in his freetime
  • is not a native english speaker
  • feels reminded of the following scene form pulp fiction:

VINCENT
A "please" would be nice.

The Wolf stops and turns around.

THE WOLF
Come again?

VINCENT
I said a "please" would be nice.

The Wolf takes a step toward him.

THE WOLF
Set is straight, Buster. I'm not
here to say "please." I'm here to
tell you what to do. And if self-
preservation is an instinct you
possess, you better fuckin' do it
and do it quick. I'm here to help.
If my help's not appreciated, lotsa
luck gentlemen.

JULES
It ain't that way, Mr. Wolf. Your
help is definitely appreciated.

VINCENT
I don't mean any disrespect. I
just don't like people barkin'
orders at me.

THE WOLF
If I'm curt with you, it's because
time is a factor. I think fast, I
talk fast, and I need you guys to
act fast if you want to get out of
this. So pretty please, with sugar
on top, clean the fuckin' car.

So back to business, mr wolf: urbandictionary.com gives the following explanation for "no dice"

No dice: An outright refusal, denial or rebuttal; essentially, shorthand for 'no fucking way'.

Joe: Hey Johnboy, can I borrow a cigarette?
Johnboy: 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

The AL - March 17, 2008 - 13:50

Okaaaaaaaaaaaaaay. *cough* I'll just rewrite the function myself. ;-)

 
 

Drupal is a registered trademark of Dries Buytaert.