Hi Guys,
I have used the following to populate images & text into the component
img src="images/iDampHome.png" alt="Smiley face" height="42" width="42"> Home
img src="images/iDampHome.png" alt="Smiley face" height="42" width="42"> Contacts
img src="images/iDampHome.png" alt="Smiley face" height="42" width="42"> Other
‘’’
I have taken out the greater than so it shows okay ( whats the correct way to show this ?)
This works fine but when I try the code form the Hamburger sample i.e.
Hamburger1.onclick=function(s){
if (typeof(s) == "object") {
return;
if (s == "img src="images/iDampHome.png" alt="Smiley face" height="42" width="42"> Home") { ( with the greater than added)
// Do code For sign out.
}
}
I don’t get the result. I tried surrounding in different brackets etc.
I found ‘Hamburger1.selection’ which returns the text at the end of the string. e.g. on the first item it returns ‘Home’.
Hamburger1.onclick=function(s){
if (typeof(s) == "object") {
return;
}
var selection = Hamburger1.selection;
$.jGrowl('selected is '+Hamburger1.selection,{ life: 2000 });
//if(Hamburger1.selection == 'Contacts') { $.jGrowl('Going to contact ',{ life: 2000 }); ChangeForm(formContacts)};
//if(Hamburger1.selection = 'Home') {$.jGrowl('going to splash',{ life: 2000 }); ChangeForm(formSplash)};
if(selection = 'Contacts') $.jGrowl('Going to contact ',{ life: 1000 });
if(selection = 'Home') $.jGrowl('going to splash',{ life: 1000 });
$.jGrowl(Object.prototype.toString.call(selection),{ life: 1000 });
}
-
Without the
if (typeof(s) == “object”) {
return;
I get duplicate message. I don’t understand why this happens. -
with the above code both if statements run. I have tried ‘=’ ‘==’ ‘===’ and I get both statements running or none.
I don’t see anything wrong with my code logic for this.
testHamburger.nsx (19.1 KB)
Cheers
Steve Warby