Advertisement

Purity III - change logo between desktop and mobile

Everything to do with Joomla! 3.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
skelterdev
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Wed Jun 25, 2014 7:57 am

Purity III - change logo between desktop and mobile

Post by skelterdev » Mon Jun 30, 2014 10:06 am

Hello all,

How can i change the logo of purity for a banner (800px*300px) for the desktop version and for the mobile version just show the text
i'm using the Purity III on J3.3
Thanks

Advertisement
User avatar
sitesrus
Joomla! Ace
Joomla! Ace
Posts: 1469
Joined: Mon Nov 12, 2012 10:48 pm

Re: Purity III - change logo between desktop and mobile

Post by sitesrus » Tue Jul 01, 2014 9:26 pm

Add custom JS through proper channels (like custom.js for some template providers, via your own plugin/module, get a free extension to add your custom js, etc.) so it's not a hack.

Than write something that uses jquery to hit the logo's id and swap the source of the image.

$('#<logo-id>').src('images/mobile-logo.jpg');

Problem with that though is you'd have to add a regex and check user agent maybe to see if it's a smart phone/tablet before doing that.

Or you can add in custom css (same as above, don't hack it) that uses a media query to override the logo on the page,

/* phones */
@media only screen and (max-width: 760px) {
#<logo-id> { background: url('smiley.gif') no-repeat; }
}

The solution depends if the logo uses css or has the source in the html (ie div w/ background or img with source) but either approach is possible.

Some templates even load the logo as an HTML module in which case you can use joomla built in styles to hide it for mobile/tablet or desktop. You can have two modules and each with the correct style to show it on the right display.
I like working with Joomla :). I offer the following professional services: Custom extension development, SEO/marketing, maintenance/support, security and WCAG audits, and will work on websites at a reasonable rate.

skelterdev
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Wed Jun 25, 2014 7:57 am

Re: Purity III - change logo between desktop and mobile

Post by skelterdev » Wed Jul 09, 2014 2:36 pm

Thanks :)

Advertisement

Locked

Return to “Templates for Joomla! 3.x”