Introduction:
I have a repeater with linkbuttons, and when I click on some button, I want it and only it to become transparent, and that the rest of the buttons wouldn't change.
D-Tails:
I have a Repeater of LinkButtons:
<div style="position: relative">
<asp:Repeater runat="server" ID="repStatuses"
onitemdatabound="repStatuses_ItemDataBound"
onitemcommand="repStatuses_ItemCommand">
<ItemTemplate>
<div id="divLinkBtn" style="display:inline"><asp:LinkButton ID="linkBtnStatuses" runat="server" CommandName="ShowText"
CommandArgument='<%# Eval("Priority") + ";" + Eval("LevelID") + ";" + Eval("ID") %>'
OnClientClick='<%# "MyFunc(" + Eval("Priority") + ");" %>'>
<div runat="server" id="divSts" class="fontAriel" ></div>
</asp:LinkButton></div>
</ItemTemplate>
</asp:Repeater>
</div>
The LinkButtons fade in on Page_Load using the following Jquery function. Here's the Page_Load and the jquery code:
Page_Load:
protected void Page_Load(object sender, EventArgs e)
{
SetPageTitle();
if (!Page.IsPostBack)
{
LoadStatusesAndButtons();
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "tmp", "<script type='text/javascript'>LoadBarWithFadeIN();</script>", false);
}
else
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "tmp", "<script type='text/javascript'>LoadBar();</script>", false);
}
Jquery
function LoadBarWithFadeIN() {
$(document).ready(function () {
$('a[id*="repStatuses"]').each(function () {
$(this).show(2500);
$(this).delay(1000);
});
});
}
function LoadBar() {
$(document).ready(function () {
$('a[id*="repStatuses"]').each(function () {
$(this).show(0);
});
});
}
When I click on some LinkButton, it becomes Transparent.
I found that this code
makes only the first linkButtons transparent:
$(document).ready(function () {
$('#divLinkBtn').click(function () {
alert('divlinkbutton presed');
$(this).css({ 'opacity': 0.4 });
});
});
THE PROBLEM IS that the button becomes transparent for a second and then the page loads the LoadBar()
function and the transparency dissapears.
Another thing is that this function does not handle the rest of the buttons.
Now what I need is that this LinkButton should stay transparent until I click on some other linkbutton.
I was thinking of a way to load all the unclicked buttons as is and somehow load the specific clicked button with the trancparency but I can't find a way of doing this due to lack of coding experience.
Sorry for the "short" post :)
Any help'd be much appreciated!!!!!