如何将我自己的按钮连接到下载库



有人知道我如何将自己的按钮连接到downloadify库吗而不是使用

<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

提前感谢

您可以指定任何id。

Downloadify.create( id_or_DOM_element, options );

最好的解决方案是"setlio"所说的您将按钮图像设置为透明图像,并将您想要的文本或图片放在其下方

最新更新