Skip to content

Commit

Permalink
set focus current page
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Apr 9, 2012
1 parent f750c8f commit bcf4a96
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 18 deletions.
38 changes: 32 additions & 6 deletions ImagesLibrary.aspx
Expand Up @@ -74,31 +74,31 @@
<table align="center" cellpadding="0" cellspacing="0" border="0" style="padding-top: 20px">
<tr>
<td>
<a href="Default.aspx" target="_blank">Trang Chủ</a>
<a id="default" href="Default.aspx" target="_blank" class='menu_i'>Trang Chủ</a>
</td>
<td width="60px" align="center">
&nbsp;
</td>
<td>
<a href="Services.aspx" target="_blank">Dịch Vụ</a>
<a id="service" href="Services.aspx" target="_blank" class='menu_i'>Dịch Vụ</a>
</td>
<td width="60px" align="center">
&nbsp;
</td>
<td>
<a href="News.aspx" target="_blank">Tin Tức</a>
<a id="list" href="List.aspx" target="_blank" class='menu_i'>Tin Tức</a>
</td>
<td width="60px" align="center">
&nbsp;
</td>
<td>
<a href="ImagesLibrary.aspx" target="_blank">Thư Viện</a>
<a id="image_library" href="ImagesLibrary.aspx" target="_blank" class='menu_i'>Thư Viện</a>
</td>
<td width="60px" align="center">
&nbsp;
</td>
<td>
<a href="Contact.aspx" target="_blank">Liên Hệ</a>
<a id="contact" href="Contact.aspx" target="_blank" class='menu_i'>Liên Hệ</a>
</td>
</tr>
</table>
Expand Down Expand Up @@ -304,7 +304,7 @@
<script type="text/javascript">
$(document).ready(function () {
setFocusCurrentPage();
MainContentW = 1000;
LeftBannerW = 125;
RightBannerW = 125;
Expand Down Expand Up @@ -467,4 +467,30 @@
savedirection: true,
random: true
});
function setFocusCurrentPage(){
var url = document.location.href;
if(url.indexOf("Default.aspx") != -1){
$('#default')[0].style.color = '#FF7F50';
}
if (url.indexOf("Services.aspx") != -1) {
$('#service')[0].style.color = '#FF7F50';
}
if (url.indexOf("List.aspx") != -1) {
$('#list')[0].style.color = '#FF7F50';
}
if (url.indexOf("ImagesLibrary.aspx") != -1) {
$('#image_library')[0].style.color = '#FF7F50';
}
if (url.indexOf("Contact.aspx") != -1) {
$('#contact')[0].style.color = '#FF7F50';
}
$('.menu_i').each(function () {
$(this).mouseover(function () {
if (this.style.color) this.style.color = 'orange';
});
$(this).mouseout(function () {
if (this.style.color) this.style.color = '#FF7F50';
});
});
}
</script>
2 changes: 1 addition & 1 deletion Service.aspx.cs
Expand Up @@ -18,7 +18,7 @@ protected void Page_Load(object sender, EventArgs e)
{
using (SqlCommand scom = new SqlCommand("Select description from News where id = -2", scon))
{
//SqlDataReader sreader = scom.ExecuteReader();
SqlDataReader sreader = scom.ExecuteReader();
sreader.Read();
content.Text = sreader.GetValue(0).ToString();
}
Expand Down
44 changes: 35 additions & 9 deletions Site.master
Expand Up @@ -54,31 +54,31 @@
<table align="center" cellpadding="0" cellspacing="0" border="0" style="padding-top: 20px">
<tr>
<td>
<a href="Default.aspx" target="_blank">Trang Chủ</a>
<a id="default" href="Default.aspx" target="_blank" class='menu_i'>Trang Chủ</a>
</td>
<td width="60px" align="center">
&nbsp;
</td>
<td>
<a href="Services.aspx" target="_blank">Dịch Vụ</a>
<a id="service" href="Services.aspx" target="_blank" class='menu_i'>Dịch Vụ</a>
</td>
<td width="60px" align="center">
&nbsp;
</td>
<td>
<a href="List.aspx" target="_blank">Tin Tức</a>
<a id="list" href="List.aspx" target="_blank" class='menu_i'>Tin Tức</a>
</td>
<td width="60px" align="center">
&nbsp;
</td>
<td>
<a href="ImagesLibrary.aspx" target="_blank">Thư Viện</a>
<a id="image_library" href="ImagesLibrary.aspx" target="_blank" class='menu_i'>Thư Viện</a>
</td>
<td width="60px" align="center">
&nbsp;
</td>
<td>
<a href="Contact.aspx" target="_blank">Liên Hệ</a>
<a id="contact" href="Contact.aspx" target="_blank" class='menu_i'>Liên Hệ</a>
</td>
</tr>
</table>
Expand Down Expand Up @@ -254,14 +254,14 @@
<script type="text/javascript">

$(document).ready(function () {

setFocusCurrentPage();
MainContentW = 1000;
LeftBannerW = 15;
RightBannerW = 15;
LeftAdjust = 5;
RightAdjust = 5;
TopAdjust = $(window).height() / 2 - 90;

function FloatTopDiv() {
startLX = 0, startLY = TopAdjust;
var d = document;
Expand All @@ -280,8 +280,8 @@
var pY = document.body.scrollTop;
startLY = TopAdjust; startRY = TopAdjust;
ftlObj2.y += (pY + startLY - ftlObj2.y) / 16;
ftlObj2.sP(ftlObj2.x, ftlObj2.y-30);
ftlObj2.sP(ftlObj2.x, ftlObj2.y - 30);

setTimeout("stayTopLeft()", 1);
}

Expand Down Expand Up @@ -352,6 +352,32 @@
savedirection: true,
random: true
});
function setFocusCurrentPage(){
var url = document.location.href;
if(url.indexOf("Default.aspx") != -1){
$('#default')[0].style.color = '#FF7F50';
}
if (url.indexOf("Services.aspx") != -1) {
$('#service')[0].style.color = '#FF7F50';
}
if (url.indexOf("List.aspx") != -1) {
$('#list')[0].style.color = '#FF7F50';
}
if (url.indexOf("ImagesLibrary.aspx") != -1) {
$('#image_library')[0].style.color = '#FF7F50';
}
if (url.indexOf("Contact.aspx") != -1) {
$('#contact')[0].style.color = '#FF7F50';
}
$('.menu_i').each(function () {
$(this).mouseover(function () {
if (this.style.color) this.style.color = 'orange';
});
$(this).mouseout(function () {
if (this.style.color) this.style.color = '#FF7F50';
});
});
}
</script>

</body>
Expand Down
2 changes: 1 addition & 1 deletion Styles/images-library.css
Expand Up @@ -8,7 +8,7 @@ body{
width:100%;
}
.menu a:hover{
color:#b2bb55;
color:#FFA500;
}
.menu a{
color:White;
Expand Down
2 changes: 1 addition & 1 deletion Styles/main.css
Expand Up @@ -15,7 +15,7 @@ a{
margin-top:25px;
}
.menu a:hover{
color:Orange;
color:#FFA500;
}

.menu a{
Expand Down

0 comments on commit bcf4a96

Please sign in to comment.