当前位置:首页 > 工作日志 > Flash As+XML
Lytebox works on Flash button
作者:None  |   更新日间:2009-5-12 11:42:36  |  访量(1003)  |  评论(5)

我們最近常使用Lytebox來進行網頁的瀏覽互動,只是若要從flash 的button去點選呼叫Lytebox或者Lightbox的時候怎麼辦呢?
主要是怎麼解決在HTML裡的<a href="xxx" rel="lyteframe" rev="width: 835px; height: 516px; scrolling: no;">,"rel"與"rev"的的標籤屬性呢?

找到官方網站釋出的方法,解決了從flash botton呼叫Lytebox的疑惑,紀錄於此。

 

【一般網頁與圖】

on (release) {
getURL("javascript:lyteflash(´http://www.google.com/´,´820´,´420´)");
}


To insert in the lytebox script :

function lyteflash(url,width,height) {

   var objLink = document.createElement(´a´);
   objLink.setAttribute(´href´,url);
   objLink.setAttribute(´rel´,´lyteframe´);
   objLink.setAttribute(´rev´,´width:´+width+´;height:´+height+´;´)
   myLytebox.start(objLink, false, true);
}

【一般網頁與圖 + Title 】

AS:

on (release) {
getURL("javascript:lyteflash(´http://www.google.com/´,´820´,´420´,´Title´)");
}


JS:

function lyteflash(url,width,height,ftitle) {

   var objLink = document.createElement(´a´);
   objLink.setAttribute(´href´,url);
   objLink.setAttribute(´rel´,´lyteframe´);
   objLink.setAttribute(´rev´,´width:´+width+´;height:´+height+´;´)
   objLink.setAttribute(´title´,ftitle);
   myLytebox.start(objLink, false, true);
}

【一般網頁與圖 + Title + Slideshow】

For Slideshow:

AS:

on (release) {
getURL("javascript:lyteshow(´http://www.yoursite.com/image1.jpg´,´Title´)");
}


JS:

function lyteshow(url,ftitle) {
   var objLink = document.createElement(´a´);
   objLink.setAttribute(´href´,url);
   objLink.setAttribute(´rel´,´lyteshow´);
   objLink.setAttribute(´title´,ftitle);
   myLytebox.start(objLink, true, false);
}

For Grouped Images:

AS:

on (release) {
getURL("javascript:lytegroup(´http://www.yoursite.com/image1.jpg´,´Title´,´MyGroup´)");
}

JS:

function lytegroup(url,ftitle,igroupname) {
   var objLink = document.createElement(´a´);
   objLink.setAttribute(´href´,url);
   objLink.setAttribute(´rel´,´lytebox[´ + igroupname+ ´]´);
   objLink.setAttribute(´title´,ftitle);
   myLytebox.start(objLink, false, false);
}

本文转自:http://blog.kyart.com.tw/article/4852962749/3593711179/

姓名:   先生  女士       验证码,看不清楚?请点击刷新验证码
评论
内容:
 
评论列表:
  • mwtjidly  2011-11-18 22:14:40 说:
    kYwI9S , [url=http://rsvefkpywumw.com/]rsvefkpywumw[/url], [link=http://gzqnjmdzgsdz.com/]gzqnjmdzgsdz[/link], http://iknnscxqrjas.com/
  • vslhylmpt  2011-11-17 2:52:32 说:
    49kmAH  <a href="http://woobosgfpfjg.com/">woobosgfpfjg</a>
  • orjgnxramm  2011-11-16 20:34:36 说:
    e0roRp , [url=http://lqovzlnynwkt.com/]lqovzlnynwkt[/url], [link=http://mtbmezzbpxze.com/]mtbmezzbpxze[/link], http://xmgwatxsfsfw.com/
  • upfvbatrqoy  2011-11-16 3:01:31 说:
    6dB7sW  <a href="http://mudxtgmgoxgo.com/">mudxtgmgoxgo</a>
  • Nonie  2011-11-15 17:36:35 说:
    Shoot, so that&acute;s that one spuopses.