JQuery :: SetOffset In Chrome With Hidden Objects?
Mar 12, 2010
I want to setOffset on items before they are shown. However, as offset() always returns {top:0,left:0} on items with display: none, this doesn't work.
I suggest not using the curTop and curLeft values if the offset is 0,0 and the item !is(:visible)
View 2 Replies
ADVERTISEMENT
Dec 4, 2010
I've been trying to implement a smooth scrolling animation in my page, which works fine in firefox and IE8 (haven't tested any older versions yet). But doesn't seem to work in google chrome (and probably safari either I guess). I have 4 divs on my page, positioned absolutely 2 by 2, only one div should be visible at a time, so the body has gotten an overflow:hidden. When an anchor-link to one of those divs is clicked the javascript gets its position,then scrolls towards it. etting the position works, but the scrolling does not work in chrome.
Now, when I remove 'overflow: hidden' from the body element, the scrolling does work in chrome, but of course adds the scrollbars which I don't want.
[Code]...
View 1 Replies
View Related
Jul 23, 2005
Can anyone tell me the best way to access a hidden object in a form? I could use a hard-coded index to the elements of the form, but it's too easy to add something before the hidden object and mess up the indexing. For example:
The form has a tagid of "myForm"
The hidden object has a tagId of "myHiddenObj"
I can get the form elements by using
var formElements = document.getElementById('myForm').elements
But there doesn't seem to be any way to do this:
document.getElementById('myHiddenObj')
Assuming I have the elements as obtained above, none of these have
worked for me either:
formElements['myHiddenObj']
formElements["myHiddenObj"]
formElements.myHiddenObj
Anyone have an idea?
View 5 Replies
View Related
Nov 23, 2005
I am finding some unusual behavior with techniques I am using to
show/hide/update data without having to refresh the page. I'm quite
sure it's developer ignorance on my part and would be grateful for any
suggestions.
My page has 10 tables with their visibility controlled by the user
making a menu selection. For example, selecting menu_1 calls a
function which displays table_1 by setting table_1's style display:
block and hides tables 2-10 by setting their respective styles to
display: none. Everything in this simple navigational approach works
as expected.
I am also using the HTTPRequest object to update relevant objects on
the page based on user input. The problem I am seeing is when the
HTTPRequest object is used to update DOM objects contained within the
"invisible" tables -- or more accurately within those tables having
their style display:none. I have tried using both the HTTPRequest
object's synchronous and asynchronous approach and am seeing the same
results.
I've tested when all of the tables are "visible" by setting their style
settings to display:block and HTTPRequest calls work as expected.
The other twist in my example is that these HTTPRequest calls are each
making a SQL query and updating a chart object within the table, which
may take about 500ms each to return. My initial impression is that it
looks as if the page is being rendered too fast because any more than
three charts on a page is when the charts start getting misplaced on
the page. Again, everything works fine when all tables are visible.
Is this a known problem with HTTPRequest, or do I need to migrate my
coding techniques to the 21th century?
View 1 Replies
View Related
May 15, 2009
I have a web app which allows users to select multiple items from a select tag. I then call a JS function on submit which collects all the options they've selected and then adds them to the value attribute of a hidden input. The options selected are then used at a later time. This works fine on IE and Firefox, but both Chrome and Safari for not adding the selected values to the value attribute of the hidden input. Are there any JS issues for Chrome and Safari that could be responsible for this?
View 2 Replies
View Related
Mar 17, 2011
I am unsure what is going on with my website? I had flash on it, and I have removed the flash and installed javascript. Everything is installed correctly from what I can see, when I go to the view page button on Dreamweaver the images rotate. When I upload it to my server they stop rotating.I have download all of the files needed for this to work, and have added them all to my server. Here is a copy of the coding.
[Code]..
View 1 Replies
View Related
Sep 5, 2009
Is there a better way to extend object with internal objects?
$.fn.bestShow = function(s) {
var d = {
width: 0,
height: 0,
order: "numeric",
orderBy: "",
[Code]...
View 3 Replies
View Related
Apr 17, 2011
Is there a way in Javascript or Jquery to return an array of all objects underneath a certain point, ie. the mouse position. Basically, I have a series of images which link to various web pages but I have a large semi transparent image positioned over the top of the other images. I want to find the href of the background image that the mouse pointer clicks over.
View 1 Replies
View Related
Jan 9, 2010
I am trying to get a simple set of Javascript tabs to work properly. I have just two tabs and I want to set up the script to have the second tab automatically hidden prior to reading the javascript code because right now it shows the contents of both tabs when the page is loading and then the second tab disappears after all the script has loaded.
I have the jquery script linked to on the page and here is the way my script looks to run the tabs:
Code:
I want to add something like style="visibility:hidden;" to the DIV that isn't shown on page load and have it added and removed as necessary when users click on the tabs. So basically I would like the generated code to look like this:
Code:
View 4 Replies
View Related
Sep 20, 2005
Specifically, assume I have a div tag of absolute dimensions. I need
to figure out, first, whether or not the text inside the div tag is
partially hidden by the overflow setting, and if so, what the hidden
text is.
Is this even possible? Obviously, the rendering engine in the browser
"knows" this information, but is it accessible through Javascript?
View 2 Replies
View Related
Oct 7, 2010
I have a tab compopenet object that works by passing a dom element to a constructor... which then finds all the relative elements to that element using .find() and adds the necessary behaviour. Now, since I have multiple tab components on the same page, I'm using each() to iterate through the dom elements and pass each into the tab component constructor function.
[Code]...
View 1 Replies
View Related
Apr 13, 2011
where can i find an example of how jQuery selects objects when using an id selector? i'm asking because i've been using a cross browser snippet to select objects and i was wondering if it's the right move to move from the snippet to jQuery. the snippet checks to see for availabe methods and depending on the one that works, it knows which browser the user is using and selects the object using that method. i also know jQuery is cross browser, so it's kinda implied, just wanna make sure.
View 1 Replies
View Related
May 28, 2010
Basically i have a good experience and knowledge with prototype.js library and also at the same time i am willing to get deeper into jquery.
I very much use oops concept now a days in almost every problem i solve using javascript, and was doing with prototype's feature to create classes and objects. Since i am now looking to get deeper into jquery, i was looking to find similar feature in jquery as well. I suppose jquery must be having a feature to create classes and do inheritance programming, but i couldn't find the way. My question to the forum is, Is there any option/feature in jquery which helps us to create classes and objects of our own probably with the support of inheritance?
View 2 Replies
View Related
Oct 7, 2010
I have a tab compopenet object that works by passing a dom element to a constructor... which then finds all the relative elements to that element using .find() and adds the necessary behaviour.Now, since I have multiple tab components on the same page, I'm using each() to iterate through the dom elements and pass each into the tab component constructor function.[code]This works fine for my purposes, but after running my code through JSLint and researching here (URL...), I've been made aware that I'm pretty much throwing these objects away, since I'm not assigning them to a variable.My question really is; is this particularly bad practice under the circumstances? If I assigned the object to a variable within .each(), I'd surely be overwriting that varibale with each iteration and essentially doing the same thing?
View 1 Replies
View Related
Aug 12, 2010
Let's say I have two images. I make one dragable. I physically move one image directly over the other. While my mouse is pressed I release it. The image underneath recognizes and gives a message indicating it's covered by the other????
View 1 Replies
View Related
Apr 14, 2011
I have a menu that is made from a ul element (with li children).
Here is an example:
<
ul id="menu" >
<
li><a href="#divEntire2">Home Page</a></li>
[Code].....
However, if I do something like $(this).css('background-color','maroon'), the text and a section of bar under it does turn maroon. This happens even I just click on the bar.
View 2 Replies
View Related
Jun 28, 2011
I'm trying to build an SVG-based galaxy map for a space game, it pulls the details from MySQL using PHP and seems to work fine with the following code:
<a xlink:href="index.php?locate=galaxy&sub=planet&x=$x&y=$y" target="_top">
<circle cx="$x" cy="$y" r="$starRadius" fill="rgb($fill)">
<title>$name</title>
[code]....
View 3 Replies
View Related
Jul 27, 2009
Is it possible to join two jQuery objects to make a new object. For example...
var e1 = $("#firstObject");
var e2 = $("#secondObject");
var combined = e1.add(e2); // This is the expression I'm looking for
[URL]
View 4 Replies
View Related
Jun 16, 2009
I have the following code, which I am trying to pass in 5 variables.
<script type="text/javascript">
$(function(){
$('#DrainStackDiameter').change(function(){
[code]....
View 2 Replies
View Related
Jun 8, 2009
I basically have several buttons that are created dynamically via a db, so I can have 1 to 40 etc. now at the moment I give each one a unique id and a hover code in the loops. see below:loops goes here..
<img src="button.jpg" alt="button" border="0" id="myButton<?=
$newCode ?>" />
$(document).ready(function(){
[code]....
View 5 Replies
View Related
Oct 24, 2009
On touchstart and touchmove event, the event object has touches and targetTouches properties (see http://bit.ly/Q6uOD), however the jQuery.Event doesn't seem to copy these properties. I tried adding them to $.event.props like this:
$.each(['touches', 'targetTouches'], function(){
if (!($.inArray($.event.props, this))) {
$.event.props.push(this);
}
});
But it doesn't seem to work. The event an event listener received via jQuery hasn't the targetTouches property even if it's accessible via event.originalEvent.targetTouches or window.event.targetTouches.
View 1 Replies
View Related
Aug 4, 2009
I have a bunch of divs with the same classname, 'mediafield':
And I have this jquery code in my header:
So I know that the click function is getting implemented.. The alert box appears however I get the following error in firebug: uncaught exception: Syntax error, unrecognized expression:[@class=mediafield] Line 0
Nothing happens when firebug is turned off... So I'm not sure why it's throwing the error.
View 5 Replies
View Related
Aug 19, 2011
I know that I can retrieve the values from a single object and place them in a <ul> with the following code :
$('document').ready(function(){
var employees = {
name: 'Mary Brown',
[code]....
View 4 Replies
View Related
Jul 20, 2011
I have a function that generate code, create a tags and i want those a tags that onclick send the name attribute to and existing div in the page
so <div class="icon"></div> load with the page
<a href ... class ="marker"></a> are created manually
$(document).ready(function(){ $('a.marker').each( function() {
[code]....
View 2 Replies
View Related
Oct 15, 2011
I have a set of div elements cached inside var divs = $('#myDivs'). Suppose another div comes along that i want to add (push) to the group. is there a simple method for doing this without selecting ones already in the group for a second time?
View 3 Replies
View Related
Sep 7, 2010
I'm making some jQuery UI elements, and once an element is created, I want to add some custom functions and variables - I don't want to clutter up other jQuery objects by putting the functions in all jQuery objects, and obviously, the variables need to be different between different objects. However, the issue is, when I re-acquire the item, I won't have access to the variable any more.
That was probably confusing. Another way of putting it:
(function($){
var _MyUI_id=0;
jQuery.fn.MyUICreate = function(opts){
this.each(function(){
var obj=$(this)
//... code to turn the object into a MyUI object omitted to be concise
obj.MyUI_id = _MyUI_id;
_MyUI_id++;
}}
})(jQuery)
//now, create one
$('#some_div').MyUICreate({});
//The desired effect would be to give me the id in #14, instead I get 'undefined'.
alert($('#some_div').MyUI_id);
My 'solution', is to create an object variable in jQuery.fn called 'Collections'. It's indexes are the names of the new types, and each contains an object, the keys of which are the IDs of the UI elements that are converted to the type, and the values the jQueries objects. This is not only hackish, but it has a LOT of potential bugs. The code for this would look like:
This is in the 'create' function, at the end.
jQuery.fn.Collections.MyUI[obj.attr('id')]=obj;
This is outside of the create function, but within the (function($){...}) scope.
//jQuery.fn.Collections is set to {} in another file.
jQuery.fn.Collections.MyUI={};
jQuery.fn.GetMyUI(id){
return jQuery.fn.Collections.MyUI(id);
}
This will allow the first block of code to work as desired, but it inserts a whole new set of bugs. What are the common ways to achieve what I am trying to do?
View 3 Replies
View Related