0

使用する代わりに、自分のボタンをdownloadifylibに接続する方法を知っている人はいますか?

<div id="downloadify"></div>

これを他のボタンや要素に割り当てたいのですが。だから私はそれが持っているカスタムボタンの使用を避けることができます。

libページのデモは次のとおりです。

<script type="text/javascript">
  Downloadify.create('downloadify',{
    filename: function(){
      return document.getElementById('filename').value;
    },
    data: function(){ 
      return document.getElementById('data').value;
    },
    onComplete: function(){ 
      alert('Your File Has Been Saved!'); 
    },
    onCancel: function(){ 
      alert('You have cancelled the saving of this file.');
    },
    onError: function(){ 
      alert('You must put something in the File Contents or there will be nothing to save!'); 
    },
    transparent: false,
    swf: 'media/downloadify.swf',
    downloadImage: 'images/download.png',
    width: 100,
    height: 30,
    transparent: true,
    append: false
  });
</script>

そしてここで見つけることができます:http: //pixelgraphics.us/downloadify/test.html

前もって感謝します

4

2 に答える 2

1

任意のIDを指定できます。

Downloadify.create( id_or_DOM_element, options );
于 2012-08-20T03:32:13.080 に答える
0

最善の解決策は、「setlio」が言ったことです。ボタンの画像を透明な画像として設定し、その下に必要なテキストまたは画像を配置します。

于 2014-12-08T11:50:30.597 に答える