2011-10-26 28 views
0

我有一個腳本,我試圖在事件點擊函數中添加HREF url :::當點擊一個按鈕時,腳本應該啓動MilkBox(lightbox) :::我的Javascript非常有限,但我可以在標題屬性中添加「HREF url」,正如你可以在下面看到的(測試),因爲我在下面看到它的效果很好,但是當我移動'+ fullurl + '到HREF它失敗。然後,它是無法加載URL :::燈箱用空URL :::啓動Mootools在事件點擊函數中添加href 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"); 
    } 

}); 
+0

把它作爲答案,並將其標記爲接受,所以這個問題將被標記爲'已解決';) – stecb

回答

0

我能解決這個問題:::它我的(自定義)TimThumb功能,導致它不工作:::底線腳本工作:::