Post by Gobbo » Mon Feb 06, 2017 4:51 pm

Hi,

I have designed three logos with different tag lines, so is it possible to have rotating logos. So every time the page is reloaded a new logo at random is displayed?

Upgraded to opencart version 3.0.3.2


Active Member

Posts

Joined
Tue Jun 22, 2010 12:38 am

Post by rjcalifornia » Mon Feb 06, 2017 11:10 pm

Use javascript:

Code: Select all

<script language="JavaScript">
 function banner() { } ; b = new banner() ; n = 0
 b[n++]= "<img name=randimg src='images/me.jpg' >"
 b[n++]= "<img name=randimg src='images/me2.jpg' >"
 b[n++]= "<img name=randimg src='images/me4.jpg' >"
 b[n++]= "<img name=randimg src='images/me5.jpg' >"
 b[n++]= "<img name=randimg src='images/me6.jpg' >"
 b[n++]= "<img name=randimg src='images/me3.jpg' >"
 i=Math.floor(Math.random() * n) ;
 document.write( b[i] )
 </script>

Image


Active Member

Posts

Joined
Fri Sep 02, 2011 1:19 pm
Location - Worldwide

Post by Gobbo » Tue Feb 07, 2017 2:13 am

Hi rjcalifornia,

In what file does this go?

I've tried to look in firebug, but its not showing me.

Upgraded to opencart version 3.0.3.2


Active Member

Posts

Joined
Tue Jun 22, 2010 12:38 am

Post by fido-x » Tue Feb 07, 2017 9:28 pm

The code would go at the end of catalog/view/theme/default/template/common/header.tpl.

If you're using a custom theme, then the code would go in catalog/view/theme/your_theme/template/common/header.tpl

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Gobbo » Wed Feb 15, 2017 9:39 pm

Thanks

Upgraded to opencart version 3.0.3.2


Active Member

Posts

Joined
Tue Jun 22, 2010 12:38 am
Who is online

Users browsing this forum: No registered users and 4 guests