This is my HTML HEAD CODE:
<html>
<head>
<title>Hoşgeldin Temsilci</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link href="css/fontawesome.min.css" rel="stylesheet" type="text/css" />
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="css/Main.css" rel="stylesheet" type="text/css" />
<script src="js/Main.js" type="text/javascript"></script>
</head>
My repeater only works with my first item. i cant select the other divs and making them colorful. this is my JS code:
function Choice() {
var box = document.getElementById("divsec");
if (!count) {
var count = 0;
}
box.onclick = function () {
count++;
if (count == 1) {
box.style.backgroundColor = "red";
}
else if (count == 2) {
box.style.backgroundColor = "green";
}
else if (count == 3) {
box.style.backgroundColor = "yellow";
}
else {
count = 0;
box.style.backgroundColor = "transparent";
}
}
}
this is my HTML code:
<asp:Repeater ID="rp_Temsilci_isler" runat="server">
<HeaderTemplate>
<table id="temsilciheader" class="temsilcitable table-hover table-condensed" border="1" width="1000px">
<tr class="headerturuncu">
<td></td>
<td><div class="markadiv">Marka<div class="arrow" onclick="sortTable(0)"></div></div></td>
<td><div class="markadiv">İşin Adı<div class="arrow" onclick="sortTable(1)"></div></div></td>
<td><div class="markadiv">Durum<div class="arrow" onclick="sortTable(2)"></div></div></td>
<td><div class="markadiv">Veriliş Tarihi<div class="arrow" onclick="sortTable(3)"></div></div></td>
<td><div class="markadiv">Teslim Tarihi<div class="arrow" onclick="sortTable(4)"></div></div></td>
<td><div class="markadiv">Marka Temsilcisi<div class="arrow" onclick="sortTable(5)"></div></div></td>
<td><div class="markadiv">Ajans Temsilcisi<div class="arrow" onclick="sortTable(6)"></div></div></td>
<td><div class="markadiv">Sorumlu Kişiler<div class="arrow" onclick="sortTable(7)"></div></div></td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td> <div id="divsec" onclick="Choice()" class="divsec"></div></td>
<td> <div class="isin_tanimi"><%#Eval("isin_tanimi") %></div></td>
<td> <div class="isin_tanimi"><%#Eval("isin_adi") %></div> </td>
<td> <div class="isin_tanimi"><%#Eval("is_durum") %></div> </td>
<td> <div class="isin_tanimi"><%#Eval("verildigi_tarih") %></div> </td>
<td> <div class="isin_tanimi"><%#Eval("teslim_tarihi") %></div> </td>
<td> <div class="isin_tanimi"><%#Eval("sorumlu_marka") %></div> </td>
<td> <div class="isin_tanimi"><%#Eval("sorumlu_ajans") %></div> </td>
<td> <div class="isin_tanimi"><%#Eval("revize") %></div> </td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
what am i doing wrong ? please help me.
i keep my JS codes in my Main.js . All codes work on main.js but if i write something like this:
$(".stileone").on("click", function() {
$(this).css("background", "red");
});
it doesnt work. Wondering why? Please help anyone ? And my question is also how i can save this bacground-color of a div after changing.after logout and login how can i keep that color ? thank you.
Comments
Post a Comment