Tagged: x
-
AuthorPosts
-
February 5, 2017 at 4:37 am #1358471
ADBLParticipantHi there —
On one (Integrity) page and all child pages, I need to display a different logo image and also modify the href (link) value.
To change the image, I’m (successfully) using:
jQuery(".x-brand img").attr("src","http://mysite.com/otherlogo.png");I wasn’t able to change the link though. I tried both:
jQuery(".x-brand img").attr({src:http://mysite.com/otherlogo.png,href:"http://mysite.com/otherlink"});and
jQuery(".x-brand img").attr("src","http://mysite.com/otherlogo.png").prop("href","http://mysite.com/otherlink");No luck. Can you guys help?
Also, is there a way so that all child page can inherit logo and link change from parent (other than adding custom code to each child page)?
Thanks a lot.
February 5, 2017 at 5:39 am #1358497
ThaiModeratorHi There,
Please try with this code:
jQuery(".x-brand").attr("href","http://mysite.com/otherlink");Hope it helps 🙂
February 5, 2017 at 7:36 am #1358576
ADBLParticipantThanks a lot!
I’m seeing that when the page loads, the default logo flashes for a couple of milliseconds. Do you know if there is a way to prevent the default logo from showing completely? TIA.
February 5, 2017 at 9:39 am #1358632
RupokMemberHi there,
Thanks for writing back. Actually the logo will be changed after loading on front-end as you are changing from front-end, so you might not avoid the flash. You can still try to use your code within onload :
(function ($) { $(window).load(function(){ //Use your JS here }); }(jQuery));I can’t guarantee but you can try this if that helps.
Cheers!
February 6, 2017 at 1:17 am #1359232
ADBLParticipantThanks a lot! Any way I could fade from default to alternate, then?
February 6, 2017 at 1:34 am #1359246
RupokMemberHi there,
That might be possible by using transition with CSS. Like :
.x-brand { -webkit-transition: all 1s; transition: all 1s; }Let’s see if that works then adjust the value.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1358471 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
