Hi,
I found this menu and i like it but the client asks me to keep the current menu open with respect to a sub page. For example, if i go to Link One page, then it should be opened by default.
Here's another clichéd problem, but I couldn't find an exact match to this.
I haven't posted any source here, as you can freely see all that is there on the link. :-)
Statement:I have a web page at http://agrimgupta.com/antaragni/
Disclaimer: Pardon me for the pathetic coding on that page. ;-) It was done on a very short interval. Improvements will be done at a later stage.
Observation: This page is functioning normally on my localhost on all browsers.
Problem: IE 8 is crawling (nearly hanging) while loading this page from the website. Although it is working fine on localhost. When on the website, It fails to render the mouseover effects, doing them in almost what seems like a minute.
Question: How to resolve this stuck up of IE? It is necessary to resolve this.
Thanks in Advance
I have the following function:
var emptyFields = false;
function checkNotEmpty(tblName, columns, className){
emptyFields = false;
$("."+className+"").each(function() {
if($.trim($(this).val()) === "" && $(this).is(":visible")){
emptyFields = true;
return false; // break out of the each-loop
}
});
if (emptyFields) {
alert("Please fill in current row before adding a new one.")
} else {
AddRow_OnButtonClick(tblName,columns);
}
}
Its checking that all elements in the table are not empty before adding a new row, and I only need to check that the last row of the table has at least an element which its not empty and not the whole table.
The className its applied to the table. Please notice, that the problem I have its checking the last row and only one element of the row has to have some text in it. (e.g. each row has 5 textboxes at least one textbox need to have some text inside in order to be able to add another row, otherwise, the alert comes up).
Any help would be apreciated.
Thanks
Hi,
I have created image gallery slider, the images of which scale with the window size. My problem is I can't seem to create the right formula to ensure that the slider is at the right position when the window is scaled.
If I am at the first image and the slider 'left' offset is 0 then the scaling works fine and my offset is correct, however when I am on image two and my slider is offset by say -1500 and then the window is resized, the slider is then at the wrong offset.
Taking this into account I figured I could just add / subtract the new window size difference from the slider offset and therefore have everything in the right position. I was wrong. It works for the first two images but then If I am at the end of my slider on the last image I get a nice big gap between the end of the last image and the border of the page.
Can someone please show my where I am going wrong please? I've spent days on this :(
The relevant code is as follows:
$(window).bind('resize', function(event, delta) {
/* Resize work images - resizes all to document width */
resizeWorkImages('div.page.work div#work ul');
/* Position slider controls */
positionSliderControls();
/* Get the difference between the old window width and the new */
var windowDiff = (gLastWindowWidth - $(window).width()) * -1;
/* Apply difference to slider left position */
var newSliderLeftPos = stripPx($('div.page.work div#work ul').css('left')) - windowDiff;
/* Apply to slider */
$('div.page.work div#work ul').css('left',newSliderLeftPos+'px')
/* Update gSlider settings */
gSlider.update();
/* Record new window width */
gLastWindowWidth = $(window).width();
});
Thanks,
eb_dev
$('.box').click(function(){
$(this).find('p').toggle(
function () {
$(this).css({"color" : "red"});
},
function () {
$(this).css({"color" : "black"});
}
);
});
if i execute this script the 'p' color will change if i click on the 'p' not on the .box class why ? And how to i make it so that 'p' color changes when i click on the .box div
Hi
I am using fanxybox 1.2.6 but it's getting closed despite of mentionig onContentClick:false
Here is the code:
$("#"+vari).fancybox({'hideOnContentClick':false }).trigger('click');
Kindly help me out
p.s: The window is loading content from other URL(via Iframe)
Hello, I have an easy script, that works in all browsers, except IE(8, haven't tryed lower versions yet).
$('.deleteItemIcon').click(function() {
var deleteConfirm = confirm('Do you really wanna delete that item?')
if (!deleteConfirm) {
return false;
}
});
Can you see a reason, why that shouldn't be working, if yes, how to make it work?
Sorry for such a simple question but I can't seem to find the solution.
I am trying to fade in and out some divs.
Divs have an ID of "div1", "div2", "div3".
My code is:
var Divs = new Array("div1", "div2", "div3");
I want to fade out one div and then fade in the next on top of it.
I have a setinterval that runs every 5 seconds and checked it works.
Inside it is this code:
$(Divs[1]).fadeOut(1000);
$(Divs[2]).fadeIn(1000);
However nothing happens when the timer method is ran. Any ideas?
I've been wrestling with this problem for a couple hours now.
Essentially, what I need to do is take the following or similar HTML:
<div id="excpdivs">
<div class="excpdiv" id="excpdiv0">
Date: <input name="excp[0][date]">
Open: <input name="excp[0][open]">
Close: <input name="excp[0][close]">
</div>
<div class="excpdiv" id="expdiv1">
Date: <input name="excp[1][date]">
Open: <input name="excp[1][open]">
Close: <input name="excp[1][close]">
</div>
and get an array similar to the following to a php script:
Array
(
[0] => Array
(
[date] => 2012-09-15
[open] => 3:00
[close] => 5:00
)
[1] => Array
(
[date] => 2012-09-16
[open] => 2:00
[close] => 5:00
)
)
My main problem is getting the values from the input elements. My latest attempt is the following:
var results = [];
$(".excpdiv").each(function(){
var item = {};
var inpts = $(this).find("input");
item.date = $(inpts.get(0)).val();
item.open = $(inpts.get(1)).val();
item.close = $(inpts.get(2)).val();
results.push(item);
});
Am I on the right track or am I hopelessly lost?
Here is the script I am using.
$('.row').each(function(){
$(this).each(function(){
if($(this).find('.name').val()==""){
$(this).find('.name').val(data.name);
$(this).find('.autonomy').val(data.autonomy);
$(this).find('.purpose').val(data.purpose);
$(this).find('.flow').val(data.flow);
$(this).find('.relatedness').val(data.relatedness);
$(this).find('.challenge').val(data.challenge);
$(this).find('.mastery').val(data.mastery);
$(this).find('.colour').val(data.colour);
done=true;
}
if(done==true){
alert("here");
return false;
}
});
});
It just seems to totally ignore the return false and I can't seem to work out why!
function testing() {
$.ajax({
type: "POST",
url: "testing.php",
data: "call="+$("#abc").val(),
success: function(msg){
alert( msg );
}
});
}
I want to post the data to testing.php but if i got special characters like & sign. it will create the problem. How do i go about it?
Thank You
$('.testimonials blockquote p')
.prepend('“')
.append('”');
...prepends and appends TWICE. How do I prepend ldquo + whatever content inside the p + rdquo?
Thanks!
Hello,
Is it possible to get the size of an element after resizing it using $(el).css()?
My code is:
function resize() {
$(".combobox").css('width', '100%');
var width = $(".combobox").width();
}
I've get the real value of the combobox only after calling the function a second time. The first time is gets the width before executing $(".combobox").css('width', '100%');
I suppose this is fault of the DOM not being recreated after the .css(). Is there any way to force DOM reloading?
Thanks in advance!
Hi
What im trying to do is that when the esc key is pressed on the text
input field (id = txtSearch), some code will run.
this is my code:
$(document).ready(function() {
$('#txtSearch').bind('keyup', function(e) {
var characterCode; // literal character code will be stored in this variable
if (e && e.which) { //if which property of event object is supported (NN4)
e = e;
characterCode = e.which;
}
else {
characterCode = e.keyCode;
}
if (characterCode == 27) //if esc key
{
//do stuff
}
});
}
It doesnt work for me. however, if i would change that line:
$('#txtSearch').bind('keyup', function(e) {
with:
$(document).bind('keyup', function(e) {
everything works. but i dont want to bind the keyup with esc to the
whole document...
any suggestions on how i can bind the the keyup only with the specific
text search element? (or its containing div or something)
Thanks!
i want move up the object, delay 1000ms , then hide it,
i get the code:
$("#test").animate({"top":"-=80px"},1500)
.animate({"top":"-=0px"},1000)
.animate({"opacity":"0"},500);
i use ".animate({"top":"-=0px"},1000)" to implement delay, it's not good.
i want:
$("#test").animate({"top":"-=80px"},1500)
.sleep(1000)
.animate({"opacity":"0"},500);
any idea? thanks! :)
dumbest question ever... but I want to somehow fill 'gid' value in data load
gid = 123;
from = 33;
to = 44;
$('#x').load('y', {'range['+gid+'][]' : [from , to]});
so I could get
[range] => Array
(
[123] => Array
(
[0] => 33
[1] => 44
)
)
but with this syntax 'range['+gid+'][]' I get 'missing : after property id'. I'm desperate...
the html
<div class="stackwrapper" id="user1"></div>
<div class="stackwrapper" id="user2"></div>
<div class="userdrawings"></div>
the javascript
$('.stackwrapper').click(function(e){
var id=$(this).attr('id');
$('.userdrawings').load('loadSession.php?user='+id).fadeIn("slow");
});
Somehow it only works at once, only at the first click on stackwrapper, when I click on the second one, the function is not triggered again.
As I've come to understand using $('.whatever').click() only works for items created initially. Additional items won't respond in the correct fashion. I was then directed to using something like $('.whatever).on('click', myFunction()). However, I'm not detecting any difference, as newly created items are not called.
Here is a JSFiddle demonstration my example code: http://jsfiddle.net/atrus6/zaKZN/
My initial input plus 'Kill' will work in the correct fashion, however any additional 'input + kill's will not not do anything. Am I incorrectly using .on() or is it something else?
I am using the .eq() method to select a specific child element of a known element. It appears that the element indices are different in IE and in Chrome/FF, as .eq(2) returns different values depending on browser. (The element I'm looking for shows up as .eq(2) in FF/Chrome, but .eq(3) in IE)
For example,
alert($(this).parent().children().eq(2).text());
shows different results depending on the browser.
Is there a better way of doing this?
Hi,
I am creating this content slider, you can view/edit here:
http://jsbin.com/esame4
I have put in place setInterval so that animation runs automatically, however, when it is run for the first time, google image is shown but not afterwords. Should be simple but i am unable to figure out the problem.
hi,
i have a proj where on change of select box i am loading data from server. how do i make sure that until the data is loaded user cant do anything else on the page ..
Is there a way to access the super object when extending objects using $.extend?
I would like to extend an object, override a method, but call the overridden superclass method in the subclass method.
I have a page with several galleries including accordions and sliders. The problem is that the page takes forever to load. Is there a way of wrapping an image in a bit of code or applying a class to it to force it to load only after everything else is loaded?
To empty a div and replace it with an image I am using:
$(this).html('');
$('<img/>', {
src: 'blah.gif'
}).appendTo(this);
Is there a better way to do this?