I have a script that I’m trying to add a HREF url in the events click function ::: When a button is clicked the script is supposed to initiate the MilkBox (lightbox) ::: My Javascript is very limited but I was able to add the “HREF url” to the title attribute as you can see below (to test), as I have it below it works good, but when I move the ‘+fullurl+’ to the HREF it fails. It then is unable to load the url ::: The lightbox initiates with an empty URL :::
$("wall").addEvents({
"mouseover:relay(div.tile)": function() {
var play = this.retrieve("play");
if (!play) {
play = new Element("div", {
styles: {
position: "absolute",
marginTop: 120,
marginLeft: 120,
width: 32,
height: 32
},
"title": "Click to play",
"class": "cur hide",
events: {
click: function() {
var tubeObject = this.getParent().retrieve("tubeObject");
var tubeObject = this.getParent().retrieve("tubeObject")
var fullurl = tubeObject.full;
milkbox.openWithFile({
href:'http://localhost/square/wp-content/uploads/2011/10/34.jpg',
title:''+fullurl+''
});
}
},
html: "<img src='http://cdn1.iconfinder.com/data/icons/CornerStone/PNG/play.png' />"
}).inject(this, "top");
this.store("play", play);
}
play.removeClass("hide");
},
"mouseout:relay(div.tile)": function() {
this.retrieve("play").addClass("hide");
}
});
I was able to resolve the issue ::: Its my (custom) TimThumb function that caused it not to work ::: Bottom line the script works :::