0

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");
    }

});
1
  • put it as answer and mark it as accepted, so this question will be marked as 'resolved' ;)
    – stecb
    Oct 27, 2011 at 10:32

1 Answer 1

0

I was able to resolve the issue ::: Its my (custom) TimThumb function that caused it not to work ::: Bottom line the script works :::

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.