You're not using any framework, so I'm not sure why you posted this in the frameworks forum. You would have received more response from the parent javascript forum.

Are you trying to change the background on-the-fly, or do you just want to set a background image on page load?

If the first, you're doing it wrong. You'll need to set the style dynamically, not in the style attribute of the tag.

If the second, you need to do it on the server side.

Kotse

12-29-2009, 07:34 PM

You're not using any framework, so I'm not sure why you posted this in the frameworks forum. You would have received more response from the parent javascript forum.

Are you trying to change the background on-the-fly, or do you just want to set a background image on page load?

If the first, you're doing it wrong. You'll need to set the style dynamically, not in the style attribute of the tag.

If the second, you need to do it on the server side.

Oh, pardon my mistake. If a moderator would kindly move this thread to the parent javascript forum, I would be thankful.

Specifically, I want to set a background image on page load. Where the obtained 11 character video ID is placed into the "test" div's background, after obtaining the video ID from the original embedded video (which is in a seperate div).

tomws

12-29-2009, 07:55 PM

That would be much easier to do on the server-side. If you need help with that portion of it, drop a line in the PHP forum (or ASP, or whatever else you may be using).

oesxyl

12-29-2009, 08:02 PM

Oh, pardon my mistake. If a moderator would kindly move this thread to the parent javascript forum, I would be thankful.

Specifically, I want to set a background image on page load. Where the obtained 11 character video ID is placed into the "test" div's background, after obtaining the video ID from the original embedded video (which is in a seperate div).
something like this:

Oh, {PostID} is from tumblr's theme generator. I can inbox you the page, to see how it's not working.

oesxyl

12-30-2009, 11:01 PM

Oh, {PostID} is from tumblr's theme generator. I can inbox you the page, to see how it's not working.
post a link if you can.

best regards

Kotse

12-30-2009, 11:05 PM

post a link if you can.

best regards

http://onedraft.tumblr.com

The blocks with a red background and a play button are the video posts. Where the red background is supposed to be the thumbnail of the video (if it's from YouTube). Check the source, as {PostID} generates a numeric ID for the specific post.

oesxyl

12-30-2009, 11:53 PM

http://onedraft.tumblr.com

The blocks with a red background and a play button are the video posts. Where the red background is supposed to be the thumbnail of the video (if it's from YouTube). Check the source, as {PostID} generates a numeric ID for the specific post.
- generated ids are invalid, must start with a char
- the part of the script which use jquery.ready is inserted twice inside the body, what I found, line 662 and 697
anyway something stop parsing and execute javascript before this lines.

best regards

Kotse

12-31-2009, 12:07 AM

- generated ids are invalid, must start with a char
- the part of the script which use jquery.ready is inserted twice inside the body, what I found, line 662 and 697
anyway something stop parsing and execute javascript before this lines.

best regards

Well, the script has to be placed within the area of the video post, to obtain the video posts generated id (I will add a character at the beginning), considering that multiple video posts on one page is possible, which is also why I wanted a general script.

Is this still possible?

oesxyl

12-31-2009, 01:03 AM

Well, the script has to be placed within the area of the video post, to obtain the video posts generated id (I will add a character at the beginning), considering that multiple video posts on one page is possible, which is also why I wanted a general script.
I understand, that's because of {PostID} which is local in the template for each block.

Is this still possible?
yes, and if I'm not wrong it's easy. You can get all div elements with class name 'block_contains' and you can use jquery.each to append the code as you want.
I assume that you don't use 'div.block_containts' combination in another place and each have a id.
In my opinion first step is to make it work for a div with a given id, first for example, and then extend for the script for all.

best regards

Kotse

01-01-2010, 01:15 AM

I understand, that's because of {PostID} which is local in the template for each block.

yes, and if I'm not wrong it's easy. You can get all div elements with class name 'block_contains' and you can use jquery.each to append the code as you want.
I assume that you don't use 'div.block_containts' combination in another place and each have a id.
In my opinion first step is to make it work for a div with a given id, first for example, and then extend for the script for all.

best regards

I've figured out a different way to do this. Anyway, thanks for the help! :)

oesxyl

01-01-2010, 01:20 AM

I've figured out a different way to do this. Anyway, thanks for the help! :)
you are welcome. I'm glad you solved, :)