How to disable weekends in the ajax calender extender? - asp.net

I have implemented the following code: this function not call
My Html Code is:
<asp:CalendarExtender ID="CalendarExtender1" runat="server" Format="dd/MM/yy" PopupButtonID="ImageButton1" PopupPosition="BottomRight" Enabled="true" OnClientDateSelectionChanged="DisableWeekends" TargetControlID="txtStartDate">
onclientshown=`"DisableWeekends"
The function is give below:
function DisableWeekends(sender, args) {
for (var i = 0; i < sender._days.all.length; i++) {
for (var j = 0; j < 6; j++) {
if (sender._days.all[i].id == "DisabledWeekendsCalendar" + j + "_5") {
sender._days.all[i].disabled = true;
sender._days.all[i].innerHTML =
"<div>" + sender._days.all[i].innerText + "</div>";
}
if (sender._days.all[i].id == "DisabledWeekendsCalendar" + j + "_6") {
sender._days.all[i].disabled = true;
sender._days.all[i].innerHTML =
"<div>" + sender._days.all[i].innerText + "</div>";
}
}
}
}

Try this
<script type="text/javascript">
//disable sunday
function detect_sunday(sender, args) {
if (sender._selectedDate.getDay() == 0) {
sender._selectedDate = new Date();
// set the date back to the current date
sender._textbox.set_Value(sender._selectedDate.format(sender._format));
alert("You can't select sunday!");
}
}
</script>
<asp:CalendarExtender ID="calenderExtender" runat="server" CssClass="cal_theme" TargetControlID="txtCalender"
PopupButtonID="BtnCalender" OnClientDateSelectionChanged="detect_sunday"/>

Using CSS
.DisableWeekends .ajax__calendar_days table tbody tr td:first-child
{
text-decoration: line-through;
color: red;
pointer-events: none;
cursor: default;
}
After that add DisableWeekends class in CalendarExtender controller.

Related

Save dark mode in php cookies

I worked on a simple little code for black mode
I would just like to store the theme for the user in cookies for x time
My Dark Theme in css :
body {
padding: 0px;
color: black;
font-size: 25px;
background-color: white;
}
.dark-mode .mainSection {
background-color: black;
color: white;
padding: 600px;
padding-top: 470px;
}
Html
<div id="dark-mode">
<li><font size="2">
<a class="nav-link" onclick="myFunction()">Dark Mode</font
</li>
</div>
Javascript :
function myFunction() {
var element = document.body;
element.classList.toggle("dark-mode");
}
Thank you
Simply set the cookie using javascript, and the next time the client makes the request to server, the cookies will be send along with it. The below code should work
function createCookie(name, value, timeInSeconds) {
var date = new Date();
date.setTime(date.getTime()+(timeInSeconds*1000));
var expires = "; expires="+date.toGMTString();
document.cookie = name+"="+value+expires+"; path=/";
}
function getCookie(cname) {
let name = cname + "=";
let decodedCookie = decodeURIComponent(document.cookie);
let ca = decodedCookie.split(';');
for(let i = 0; i <ca.length; i++) {
let c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function myFunction() {
var element = document.body;
const isDarkModeOn = element.classList.toggle("dark-mode");
createCookie("isDarkModeOn", isDarkMode.toString(), 60 * 60 * 24); // 1 day expiry date
}
window.onload = function () {
const isDarkModeOn = getCookie("isDarkModeOn");
if(isDarkModeOn === "true") document.body.classList.add("dark-mode");
}
After that simply check the cookie in PHP,
<?php
$isDarkModeOn = $_COOKIE["isDarkModeOn"] === "true";
if($isDarkModeOn) {
echo "Dark Mode is on";
}
?>

Mobile Safari Crashing with background-position css

I have the following code which crashes in mobile safari, works in all other browsers. I have a checkbox that is using jquery plugin for displaying a nicer image when it is checked. The issue seems to be in the background-position attribute support in Safari-mobile but I don't know how to fix it.
<input type="checkbox" id="terms" data-bind="checked: termsOfUseAccepted" >
<label for="terms" class="" data-bind="text:TermsLabel"></label>
<div class="chk-overview ">
<h2 >Continue</h2>
</div>
Following Javascript is used
$(function () {
var isTouch = false;
try { isTouch = "ontouchstart" in window; } catch (e) { }
var $activeTip = null;
if (isTouch) {
document.ontouchstart = function () {
if ($activeTip) {
$activeTip.data("close").call($activeTip);
$activeTip = null;
}
};
}
function courseViewModel() {
var self = this;
self.termsOfUseAccepted = ko.observable(false);
self.TermsLabel = ko.observable('I understand');
self.continueDisplay = ko.computed({
read: function() {
return self.termsOfUseAccepted();
},
owner: this,
deferEvaluation: true
});
};
var viewModel = new courseViewModel();
ko.applyBindings(viewModel);
});
(function($) {
$.fn.hoverIntent = function(f, g) {
var cfg = {sensitivity: 7,interval: 100,timeout: 0};
cfg = $.extend(cfg, g ? {over: f,out: g} : f);
var cX, cY, pX, pY;
var track = function(ev) {
cX = ev.pageX;
cY = ev.pageY
};
var compare = function(ev, ob) {
ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
if ((Math.abs(pX - cX) + Math.abs(pY - cY)) < cfg.sensitivity) {
$(ob).unbind("mousemove", track);
ob.hoverIntent_s = 1;
return cfg.over.apply(ob, [ev])
} else {
pX = cX;
pY = cY;
ob.hoverIntent_t = setTimeout(function() {
compare(ev, ob)
}, cfg.interval)
}
};
var delay = function(ev, ob) {
ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
ob.hoverIntent_s = 0;
return cfg.out.apply(ob, [ev])
};
var handleHover = function(e) {
var ev = jQuery.extend({}, e);
var ob = this;
if (ob.hoverIntent_t) {
ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t)
}
if (e.type == "mouseenter") {
pX = ev.pageX;
pY = ev.pageY;
$(ob).bind("mousemove", track);
if (ob.hoverIntent_s != 1) {
ob.hoverIntent_t = setTimeout(function() {
compare(ev, ob)
}, cfg.interval)
}
} else {
$(ob).unbind("mousemove", track);
if (ob.hoverIntent_s == 1) {
ob.hoverIntent_t = setTimeout(function() {
delay(ev, ob)
}, cfg.timeout)
}
}
};
return this.bind('mouseenter', handleHover).bind('mouseleave', handleHover)
}
})(jQuery);
(function($) {
jQuery.fn.customInput = function () {
$(this).each(function (i) {
if ($(this).is('[type=checkbox],[type=radio]')) {
var input = $(this);
if (input.data('customInput') === 'done') {
return true;
}
else {
input.data('customInput', 'done');
}
// get the associated label using the input's id
var label = $('label[for=' + input.attr('id') + ']');
//get type, for classname suffix
var inputType = (input.is('[type=checkbox]')) ? 'checkbox' : 'radio';
// wrap the input + label in a div
$('<div class="custom-' + inputType + '"></div>').insertBefore(input).append(input, label);
// find all inputs in this set using the shared name attribute
var allInputs = $('input[name=' + input.attr('name') + ']');
// necessary for browsers that don't support the :hover pseudo class on labels
label.hover(
function () {
$(this).addClass('hover');
if (inputType == 'checkbox' && input.is(':checked')) {
$(this).addClass('checkedHover');
}
},
function () { $(this).removeClass('hover checkedHover'); }
);
//bind custom event, trigger it, bind click,focus,blur events
input.bind('updateState', function () {
if (input.is(':checked')) {
if (input.is(':radio')) {
allInputs.each(function () {
$('label[for=' + $(this).attr('id') + ']').removeClass('checked');
});
};
label.addClass('checked');
}
else { label.removeClass('checked checkedHover checkedFocus'); }
})
.trigger('updateState')
.click(function () {
if (input.is(':checked')) {
if (input.is(':radio')) {
allInputs.each(function () {
$('label[for=' + $(this).attr('id') + ']').removeClass('checked');
});
};
label.addClass('checked');
}
else { label.removeClass('checked checkedHover checkedFocus'); }
})
.focus(function () {
label.addClass('focus');
if (inputType == 'checkbox' && input.is(':checked')) {
$(this).addClass('checkedFocus');
}
})
.blur(function () { label.removeClass('focus checkedFocus'); });
}
});
};
})(jQuery);
$.fn.smartHover = function (configObject) {
if (isTouch) {
$(this)
.bind("hold", function () {
$activeTip = $(this);
$(this).data("held", true);
})
.bind("hold", configObject.over)
.bind("click", function (e) {
var wasHeld = $(this).data("held");
$(this).data("held", false);
if (wasHeld) {
e.preventDefault();
return false;
}
})
.data("close", configObject.out);
} else {
$(this).hoverIntent(configObject);
}
};
$('input').customInput();
And here is the css
.chk-overview h2 { font: 24px "StoneSansITCW01-SemiBol 735693",sans-serif; margin-bottom: 20px;padding: 0 }
.custom-checkbox label {
background: transparent url(http://aonhewittnavigators.com/AonExchange/media/Image-Gallery/SiteImages/checkbox.png) no-repeat;
outline: 0;
background-position: 0 0;
}
.custom-checkbox label {
cursor: pointer;
display: block;
height: 19px;
outline: 0;
position: relative;
width: 21px;
z-index: 1;
}
.custom-checkbox label.checked {
background-position: 0 bottom;
padding: 0;
}
.custom-checkbox input {
left: 1px;
margin: 0;
outline: 0;
position: absolute;
top: 5px;
z-index: 0;
height: 0;
}
Try removing the height: 0 on the checkbox style. I have seen it crash when the height or width attribute is set on the checkbox input.

How to make Dropdownlist have multiple checkboxes?

I have an aspx page and within the page I have a dropdownlist. On pageload, I add some choices to the dropdownlist. But I want to be able to select more than one option from this list when I click the dropdownlist, like a window which opens below of it and has a checkboxlist with the same choices.
How can I add multiple checkboxes to the dropdownlist, or make a checkboxlist in this manner? Should I use JQuery?
Thanks in advance.
For MultiCheckbox Dropdown in Asp.net , Use the following code enter image description here
First refer the ajaxtoolkit assembply in file
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
Then add Script Manager
<asp:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release">
</asp:ScriptManager>
Use the following Html Code
<asp:TextBox ID="txtClient" placeholder="Select Clients" runat="server" CssClass="txtbox" ReadOnly="true" Height="28px" Width="250px" Style="margin-bottom: auto; text-align: center; background-color: White; cursor: pointer; border-color: black; margin: 1px;"></asp:TextBox>
<asp:Panel ID="PnlClientlist" runat="server" CssClass="PnlDesign" Style="">
<asp:CheckBox ID="cbAll" runat="server" Text="Select All" BackColor="Aqua" onclick="CheckAll();" />
<asp:CheckBoxList ID="drpClients" runat="server" onclick="UnCheckAll();">
</asp:CheckBoxList>
</asp:Panel>
<cc1:PopupControlExtender ID="PceSelectClient" runat="server" TargetControlID="txtClient"
PopupControlID="PnlClientlist" Position="Bottom">
</cc1:PopupControlExtender>
Add the above reference in cocde
Use Css and JS:
function CheckAll() {
var count = 0;
$('#' + '<%=drpClients.ClientID %>' + ' input:checkbox').each(function () {
count = count + 1;
});
for (i = 0; i < count; i++) {
if ($('#' + '<%=cbAll.ClientID %>').prop('checked') == true) {
if ('#' + '<%=drpClients.ClientID %>' + '_' + i) {
if (('#' + '<%=drpClients.ClientID %>' + '_' + i).disabled != true)
$('#' + '<%=drpClients.ClientID %>' + '_' + i + ':checkbox').prop('checked', true);
}
}
else {
if ('#' + '<%=drpClients.ClientID %>' + '_' + i) {
if (('#' + '<%=drpClients.ClientID %>' + '_' + i).disabled != true)
$('#' + '<%=drpClients.ClientID %>' + '_' + i + ':checkbox').prop('checked', false);
}
}
}
}
function UnCheckAll() {
var flag = 0;
var count = 0;
$('#' + '<%=drpClients.ClientID %>' + ' input:checkbox').each(function () {
count = count + 1;
});
for (i = 0; i < count; i++) {
if ('#' + '<%=drpClients.ClientID %>' + '_' + i) {
if ($('#' + '<%=drpClients.ClientID %>' + '_' + i).prop('checked') == true) {
flag = flag + 1;
}
}
}
if (flag == count)
$('#' + '<%=cbAll.ClientID %>' + ':checkbox').prop('checked', true);
else
$('#' + '<%=cbAll.ClientID %>' + ':checkbox').prop('checked', false);
}
.PnlDesign
{
border: solid 1px #000000;
height: 300px;
width: 330px;
overflow-y: scroll;
background-color: white;
font-size: 15px;
font-family: Arial;
width: 450px;
}
.txtbox
{
background-image: url(img/drpdwn.png);
background-position: right center;
background-repeat: no-repeat;
cursor: pointer;
cursor: hand;
background-size: 20px 30px;
}
Probably you have to implement a custom control.
Take a look: http://www.codeproject.com/Articles/18063/Multi-select-Dropdown-list-in-ASP-NET
In My razor view it works please change to required aspx view
#Html.DropDownList("selectedclients", new SelectList(Model.ListClients, "ClientId", "FullName", 1), "---Select clients---", new { #class =multiple = "multiple", id = "clients" })
where ListClients is an IEnumerable list
also add jquery-1.4.4.min.js and jquery.multiSelect.js in view
and in load add
<script type="text/javascript">
$(document).ready(function () {
$("#clients").multiSelect({ oneOrMoreSelected: '*' });
});
</script>

IE: nth-child() using odd/even isn't working

My table (that works perfectly on Chrome, FireFox and Opera) is not displaying correctly on Internet Explorer.
The background remains white! (I am using IE-8)
CSS code:
/*My Table*/
.my_table{
border-collapse:collapse;
font:normal 14px sans-serif,tahoma,arial,verdana;
margin:5px 0;
}
.my_table th{
color:#fff;
background:#5E738A;
border:1px solid #3C5169;
text-align:center;
padding:4px 10px;
}
.my_table td{
color:#555;
border:1px solid #C1CAD4;
text-align:center;
padding:2px 5px;
}
.my_table tr:nth-child(even){
background:#E6EDF5;
}
.my_table tr:nth-child(odd){
background:#F0F5FA;
}
As a good workaround, jQuery has added this to their project and achieving this using JavaScript is acceptable:
For my CSS, I would have
.my_table tr.even{
background:#E6EDF5;
}
.my_table tr.odd{
background:#F0F5FA;
}
And I would use jQuery to do this:
$(document).ready(function() {
$(".my_table tr:nth-child(even)").addClass("even");
$(".my_table tr:nth-child(odd)").addClass("odd");
});
IE8 doesn't support the nth-child selector I'm afraid:
http://reference.sitepoint.com/css/pseudoclass-nthchild
You can use first-child and "+" to emulate nth-child, example:
tr > td:first-child + td + td + td + td + td + td + td + td {
background-color: red;
}
That select the 9th column, just like nth-child(9), and that works on IE
This is the Dojo version, it works fine:
dojo.addOnLoad(function(){
dojo.query("table tr:nth-child(odd)").addClass("odd");
dojo.query("table tr:nth-child(even)").addClass("even");
});
I made some time ago, a prude simple javascript solution for this problem:
https://gist.github.com/yckart/5652296
var nthChild = function (elem, num) {
var len = elem.length;
var ret = [];
var i = 0;
// :nth-child(num)
if (!isNaN(Number(num))) {
for (i = 0; i < len; i++) {
if (i === num - 1) return elem[i];
}
}
// :nth-child(numn+num)
if (num.indexOf('+') > 0) {
var parts = num.match(/\w/g);
for (i = parts[2] - 1; i < len; i += parts[0] << 0) {
if (elem[i]) ret.push(elem[i]);
}
}
// :nth-child(odd)
if (num === 'odd') {
for (i = 0; i < len; i += 2) {
ret.push(elem[i]);
}
}
// :nth-child(even)
if (num === 'even') {
for (i = 1; i < len; i += 2) {
ret.push(elem[i]);
}
}
return ret;
};
The usage is quite simple and similar to the css-selector:
var rows = document.querySelectorAll('li');
var num = nthChild(rows, 2);
var formula = nthChild(rows, '3n+1');
var even = nthChild(rows, 'even');
var odd = nthChild(rows, 'odd');
// Note, forEach needs to be polyfilled for oldIE
even.forEach(function (li) {
li.className += ' even';
});
odd.forEach(function (li) {
li.className += 'odd';
});
formula.forEach(function (li) {
li.className += ' formula';
});
num.style.backgroundColor = 'black';
http://jsfiddle.net/ARTsinn/s3KLz/

Javascript or CSS hover not working in Safari and Chrome

I have a problem with a script for a image gallery. The problem seems to only occur on Safari and Chrome, but if I refresh the page I get it to work correctly - weird!
Correct function:
The gallery has a top bar, which if you hover over it, it will display a caption. Below sits the main image. At the bottom there is another bar that is a reversal of the top bar. When you hover over it, it will display thumbnails of the gallery.
The problem:
In Safari and Chrome, the thumbnail holder will not display. In fact, it doesn't even show it as an active item (or a rollover). But oddly enough, if you manually refresh the page it begins to work correctly for the rest of the time you view the page. Once you have left the page and return the same error occurs again and you have to go through the same process.
Here's one of the pages to look at:
link text
Here's the CSS:
#ThumbsGutter {
background: url(../Images/1x1.gif);
background: url(/Images/1x1.gif);
height: 105px;
left: 0px;
position: absolute;
top: 0px;
width: 754px;
z-index: 2;
}
#ThumbsHolder {
display: none;
}
#ThumbsTable {
left: 1px;
}
#Thumbs {
background-color: #000;
width: 703px;
}
#Thumbs ul {
list-style: none;
margin: 0;
padding: 0;
}
#Thumbs ul li {
display: inline;
}
.Thumbs ul li a {
border-right: 1px solid #fff;
border-top: 1px solid #fff;
float: left;
left: 1px;
}
.Thumbs ul li a img {
filter: alpha(opacity=50);
height: 104px;
opacity: .5;
width: 140px;
}
.Thumbs ul li a img.Hot {
filter: alpha(opacity=100);
opacity: 1;
}
Here is the javascript:
//Variables
var globalPath = "";
var imgMain;
var gutter;
var holder;
var thumbs;
var loadingImage;
var holderState;
var imgCount;
var imgLoaded;
var captionHolder;
var captionState = 0;
var captionHideTimer;
var captionHideTime = 500;
var thumbsHideTimer;
var thumbsHideTime = 500;
$(document).ready(function() {
//Load Variables
imgMain = $("#MainImage");
captionHolder = $("#CaptionHolder");
gutter = $("#ThumbsGutter");
holder = $("#ThumbsHolder");
thumbs = $("#Thumbs");
loadingImage = $("#LoadingImageHolder");
//Position Loading Image
loadingImage.centerOnObject(imgMain);
//Caption Tab Event Handlers
$("#CaptionTab").mouseover(function() {
clearCaptionHideTimer();
showCaption();
}).mouseout(function() {
setCaptionHideTimer();
});
//Caption Holder Event Handlers
captionHolder.mouseenter(function() {
clearCaptionHideTimer();
}).mouseleave(function() {
setCaptionHideTimer();
});
//Position Gutter
if (jQuery.browser.safari) {
gutter.css("left", imgMain.position().left + "px").css("top", ((imgMain.offset().top + imgMain.height()) - 89) + "px");
} else {
gutter.css("left", imgMain.position().left + "px").css("top", ((imgMain.offset().top + imgMain.height()) - 105) + "px");
}
//gutter.css("left", imgMain.position().left + "px").css("top", ((imgMain.offset().top + imgMain.height()) - 105) + "px");
//gutter.css("left", imgMain.offset().left + "px").css("top", ((imgMain.offset().top + imgMain.height()) - gutter.height()) + "px");
//Thumb Tab Event Handlers
$("#ThumbTab").mouseover(function() {
clearThumbsHideTimer();
showThumbs();
}).mouseout(function() {
setThumbsHideTimer();
});
//Gutter Event Handlers
gutter.mouseenter(function() {
//showThumbs();
clearThumbsHideTimer();
}).mouseleave(function() {
//hideThumbs();
setThumbsHideTimer();
});
//Next/Prev Button Event Handlers
$("#btnPrev").mouseover(function() {
$(this).attr("src", globalPath + "/Images/GalleryLeftButtonHot.jpg");
}).mouseout(function() {
$(this).attr("src", globalPath + "/Images/GalleryLeftButton.jpg");
});
$("#btnNext").mouseover(function() {
$(this).attr("src", globalPath + "/Images/GalleryRightButtonHot.jpg");
}).mouseout(function() {
$(this).attr("src", globalPath + "/Images/GalleryRightButton.jpg");
});
//Load Gallery
//loadGallery(1);
});
function loadGallery(galleryID) {
//Hide Holder
holderState = 0;
holder.css("display", "none");
//Hide Empty Gallery Text
$("#EmptyGalleryText").css("display", "none");
//Show Loading Message
$("#LoadingGalleryOverlay").css("display", "inline").centerOnObject(imgMain);
$("#LoadingGalleryText").css("display", "inline").centerOnObject(imgMain);
//Load Thumbs
thumbs.load(globalPath + "/GetGallery.aspx", { GID: galleryID }, function() {
$("#TitleHolder").html($("#TitleContainer").html());
$("#DescriptionHolder").html($("#DescriptionContainer").html());
imgCount = $("#Thumbs img").length;
imgLoaded = 0;
if (imgCount == 0) {
$("#LoadingGalleryText").css("display", "none");
$("#EmptyGalleryText").css("display", "inline").centerOnObject(imgMain);
} else {
$("#Thumbs img").load(function() {
imgLoaded++;
if (imgLoaded == imgCount) {
holder.css("display", "inline");
//Carousel Thumbs
thumbs.jCarouselLite({
btnNext: "#btnNext",
btnPrev: "#btnPrev",
mouseWheel: true,
scroll: 1,
visible: 5
});
//Small Image Event Handlers
$("#Thumbs img").each(function(i) {
$(this).mouseover(function() {
$(this).addClass("Hot");
}).mouseout(function() {
$(this).removeClass("Hot");
}).click(function() {
//Load Big Image
setImage($(this));
});
});
holder.css("display", "none");
//Load First Image
var img = new Image();
img.onload = function() {
imgMain.attr("src", img.src);
setCaption($("#Image1").attr("alt"));
//Hide Loading Message
$("#LoadingGalleryText").css("display", "none");
$("#LoadingGalleryOverlay").css("display", "none");
}
img.src = $("#Image1").attr("bigimg");
}
});
}
});
}
function showCaption() {
if (captionState == 0) {
$("#CaptionTab").attr("src", globalPath + "/Images/CaptionTabHot.jpg");
captionHolder.css("display", "inline").css("left", imgMain.position().left + "px").css("top", imgMain.position().top + "px").css("width", imgMain.width() + "px").effect("slide", { "direction": "up" }, 500, function() {
captionState = 1;
});
}
}
function hideCaption() {
if (captionState == 1) {
captionHolder.toggle("slide", { "direction": "up" }, 500, function() {
$("#CaptionTab").attr("src", globalPath + "/Images/CaptionTab.jpg");
captionState = 0;
});
}
}
function setCaptionHideTimer() {
captionHideTimer = window.setTimeout(hideCaption,captionHideTime);
}
function clearCaptionHideTimer() {
if(captionHideTimer) {
window.clearTimeout(captionHideTimer);
captionHideTimer = null;
}
}
function showThumbs() {
if (holderState == 0) {
$("#ThumbTab").attr("src", globalPath + "/Images/ThumbTabHot.jpg");
holder.effect("slide", { "direction": "down" }, 500, function() {
holderState = 1;
});
}
}
function hideThumbs() {
if (holderState == 1) {
if (jQuery.browser.safari) {
holder.css("display", "none");
$("#ThumbTab").attr("src", globalPath + "/Images/ThumbTab.jpg");
holderState = 0;
} else {
holder.toggle("slide", { "direction": "down" }, 500, function() {
$("#ThumbTab").attr("src", globalPath + "/Images/ThumbTab.jpg");
holderState = 0;
});
}
}
}
function setThumbsHideTimer() {
thumbsHideTimer = window.setTimeout(hideThumbs,thumbsHideTime);
}
function clearThumbsHideTimer() {
if(thumbsHideTimer) {
window.clearTimeout(thumbsHideTimer);
thumbsHideTimer = null;
}
}
function setImage(image) {
//Show Loading Image
loadingImage.css("display", "inline");
var img = new Image();
img.onload = function() {
//imgMain.css("background","url(" + img.src + ")").css("display","none").fadeIn(250);
imgMain.attr("src", img.src).css("display", "none").fadeIn(250);
setCaption(image.attr("alt"));
//Hide Loading Image
loadingImage.css("display", "none");
};
img.src = image.attr("bigimg");
}
function setCaption(caption) {
$("#CaptionText").html(caption);
//alert($("#CaptionText").html());
/*
if (caption.length > 0) {
$("#CaptionText")
.css("display", "inline")
.css("left", imgMain.position().left + "px")
.css("top", imgMain.position().top + "px")
.css("width", imgMain.width() + "px")
.html(caption);
$("#CaptionOverlay").css("display", "inline")
.css("height", $("#CaptionText").height() + 36 + "px")
.css("left", imgMain.position().left + "px")
.css("top", imgMain.position().top + "px")
.css("width", imgMain.width() + "px");
} else {
$("#CaptionText").css("display", "none");
$("#CaptionOverlay").css("display", "none");
}
*/
}
Please if anyone could help, it would be greatly appreciated!
Thanks in advance.
Justin
I'm using Chrome 4.1.249.1064 and the top bar works perfect, I see the caption without refreshing the page.
The same in Firefox 3.6.3, all works perfect
Same with Safari 4.0.3, all works perfect

Resources