我有一个带有图像标签的 link_to_function。我想禁用它(使其图像模糊 n 禁用单击事件)以进行页面加载。但是单击名为“button 1”的另一个按钮,然后才应该启用它。我怎样才能完成它?
带有链接的图像的CSS是
.img
{
opacity:0.4;
filter:alpha(opacity=40);
}
视图是....
<%i = 1%>
<div id = "file_<%= i %>" class = "file">
<%= link_to_function image_tag("play_images.png",:width => 30, :height => 30,:align => 'left', :title => 'Play', :id => "img_play#{i}"), :id => "play_#{i}"%>
<%= link_to_function image_tag("stop_images.png",:width => 30, :height => 30,:align => 'left', :title => 'Stop', :id => "img_stop#{i}",:class => "img"), :id => "stop_#{i}"%>
<%= link_to_function image_tag("fast_fwd.jpeg",:width => 30, :height => 30, :title => 'Fast farword', :id => "img_ff#{i}", :class => "img"), :disabled => 'true',:id => "ff_#{i}"%>
<%= link_to_function image_tag("images.jpeg",:align => 'right'), :id => "close_#{i}"%>
<div id = "request_<%= i%>" class = "request">
</div>
</div>
<%i = i + 1%>
现在,我想要的最初是 2 个带有“img”类的图像按钮将被模糊和禁用,当我点击 id 为“play_#”的按钮时,两个带有“img”类的按钮都将删除它们的类,它们将b 启用。那么如何让它们在加载时禁用并在单击播放按钮时启用。我的jquery是...
function set_file(id,time,user,node,activity)
{
var filename = "";
filename = user+"_"+node+"_"+activity+"_"+time;
jQuery("#log_"+id).ready(function() {
jQuery("#file_"+id).dialog({modal: true, resizable: false, draggable: false,
title: "File Content", width: 520,
});
jQuery("#play_"+id).click(function(){
jQuery("#img_stop"+id).removeClass();
jQuery("#img_ff"+id).removeClass();
text="content of text here";
delay=500;
currentChar=1;
destination="[not defined]";
jQuery.get('/requests/download_log/?filename=' + filename, function(data) {
});
});
jQuery("#stop_"+id).click(function(){
jQuery("#img_ff"+id).addClass('img');
jQuery("#img_stop"+id).addClass('img');
alert("Stop");
});
jQuery("#ff_"+id).click(function(){
alert("Fast Forward");
});
}