Archived

This topic is now archived and is closed to further replies.

  • 0

Using Javascript as the header image

Question

Posted · Report post

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

8 answers to this question

Posted · Report post

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

Posted · Report post

Ps. This code is in 'header.php'

Share this post


Link to post
Share on other sites

Posted · Report post

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

Posted · Report post

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

Posted · Report post

I've tried all combinations: Screen%20shot%202009-10-15%20at%204.52.57%20PM.pngScreen%20shot%202009-10-15%20at%204.45.14%20PM.png

Share this post


Link to post
Share on other sites

Posted · Report post

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

Posted · Report post

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

Posted · Report post

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