Vinny B
Posts: 0
Joined: Fri Aug 22, 2014 2:22 pm

Javascript URL assistance

Hello. I know this might be beyond normal help but if anyone can help I would appreciate it. I am trying to display images with different links to another page during different times of the day.

I have the code and the image changes depending on what time of day it is.

I need to add a link to a page that also changes with the photo.

Here is the code I found. I did add some appery code to it too.

/* This script and many more are available free online at
The JavaScript Source!! http://www.javascriptsource.com
Created by: Anonymous | http://musikimiz.googlepages.comLicensed under: Creative Commons License
*/

function pixTimeChange() {
var t=new Date();
var h = t.getHours();
var r1="files/views/assets/image/Themes_icon.png";
var r2="files/views/assets/image/Themes_icon.png";
var el=document.getElementById('customerHomePage_myimage');

Code: Select all

 //added link to image 

 var y = $(document).off("click", '#customerHomePage_mobilecontainer [name="vinnyvinny"]').on({ 
         click: function(event) { 
             if (!$(this).attr('disabled')) { 
                 Apperyio.navigateTo('custBilling', { 
                     reverse: false 
                 }); 
             } 
         } 

});

Code: Select all

 // 

// See the time below. Note: The time is in 24 hour format.
// In the example here, "7" = 7 AM; "17" =5PM.
el.src = (h=7 && h) {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
};
}
}

addLoadEvent(function() {
pixTimeChange();
});

Ihor Didevych
Posts: 0
Joined: Wed Nov 19, 2014 7:55 pm

Javascript URL assistance

Hi Vinny,

Could you clarify what part of you idea you can't realize?

P.S. Unfortunately, we can't debug or write code for you, but we can advise steps how you can achieve it

Vinny B
Posts: 0
Joined: Fri Aug 22, 2014 2:22 pm

Javascript URL assistance

when variable r1 is being shown I want variable y which is the link to the appery page to function work.

The user clicks the image of r1 and there brought to an appery page.

The user clicks the image of r2 when its shown and nothing happens.

Thank you

Vinny B
Posts: 0
Joined: Fri Aug 22, 2014 2:22 pm

Javascript URL assistance

forget this i think i am going about it the wrong way. thanks anyway.

Return to “Issues”