Jump to content
Sign in to follow this  
gandhi

Using Javascript as the header image

Recommended Posts

gandhi    0
gandhi

I did this in the iblog2 theme, where I used a small Javascript to display an image on the header of the blog and another one when the mouse went over it. I just went through the code and put it there, but in the iblogpro 3 version the code is too complicated for me to figure this out... Could you help me out? The code would be something like this: <SCRIPT LANGUAGE="JavaScript"> <!-- Begin loadImage1 = new Image(); loadImage1.src = "http://blablabla.jpg"; staticImage1 = new Image(); staticImage1.src = "http://blablabla.gif"; // End --> </script> Thanks

Share this post


Link to post
Share on other sites
Andrew    201
Andrew

Hey Gandhi, Here is the code that controls what your 'logo' looks like:

<?php if(pagepress('custom_header')):?>
				">
				" alt="<?php echo SITENAME; ?>"/>
				
			<?php else:?>
		      		<h1 id="blogtitle">"><span class="sheen"></span><?php bloginfo('name'); ?></h1>
		      		<div id="blogdescription"><?php bloginfo('description'); ?></div>
			<?php endif; ?>[/code]

if you're not using the 'custom header' option you would want to replace this section of code with your own :)

Share this post


Link to post
Share on other sites
Andrew    201
Andrew

Ps. This code is in 'header.php'

Share this post


Link to post
Share on other sites
gandhi    0
gandhi

It doesn't work! It might be because of the small icons of Twitter/Facebook that are on top of the header image? Where excatly should I replace the code? Under the if or the else?

Share this post


Link to post
Share on other sites
Andrew    201
Andrew

Just replace or comment out the above code, and replace it with your own. It controls how the logo/title appear on your site. If it still doesn't work, feel free to post the code you tried, and the results. Screenshots always help.

Share this post


Link to post
Share on other sites
gandhi    0
gandhi

Whenever the javascript is supposed to appear, I get nothing. I know it's trying, but it seems like for some reason the code doesn't load...

Share this post


Link to post
Share on other sites
Andrew    201
Andrew

Can you give me a 'live' link? Have you tried using FireBug for Firefox to see if your getting any JS errors? The second one is the correct implementation...

Share this post


Link to post
Share on other sites
gandhi    0
gandhi

Ok, got it working. It turned out to be a JavaScript error... If anyone has the same problem, ask me!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×