The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Header Image css?

2 posters

Go down

In progress Header Image css?

Post by Wealh November 9th 2015, 6:37 pm

Ange Tuteur wrote:If it's for all forum pages you can do this :
Code:
$(function() {
  if (/\/f\d+/.test(window.location.href)) {
    document.body.className += ' forum-page';
  }
});

If it's for that page only, you can do this instead :
Code:
$(function() {
  if (/\/f2(?:-|p\d+-)websites/.test(window.location.href)) {
    document.body.className += ' forum-page-websites';
  }
});
The number "2" is the forum ID.

I want to edit the header image on a specific page, how?
Wealh
Wealh
Forumember

Posts : 69
Reputation : 6
Language : English

http://boredom.iftopic.com/

Back to top Go down

In progress Re: Header Image css?

Post by Ange Tuteur November 9th 2015, 6:43 pm

Which specific page were you thinking ? Also, which forum version too ? Almost all versions have a unique selector for the banner logo.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: Header Image css?

Post by Wealh November 9th 2015, 8:39 pm

Ange Tuteur wrote:Which specific page were you thinking ? Also, which forum version too ? Almost all versions have a unique selector for the banner logo.

Punbb.

http://boredom.iftopic.com/
Wealh
Wealh
Forumember

Posts : 69
Reputation : 6
Language : English

http://boredom.iftopic.com/

Back to top Go down

In progress Re: Header Image css?

Post by Ange Tuteur November 9th 2015, 8:50 pm

Using this script as an example :
Code:
$(function() {
  if (/\/f2(-|p\d+-)websites/.test(window.location.href)) {
   
  }
});

We can modify the logo element source inside the condition, like this :
Code:
$(function() {
  if (/\/f2(-|p\d+-)websites/.test(window.location.href)) {
    document.getElementById('pun-logo').firstChild.src = '/img_src.png';
  }
});

Just replace
Code:
/img_src.png
with the URL to your image. Wink
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum