Hello all,
if you have 2 seconds to spare, please see
http://www.tilmauder.com/as4/JS2ASinJquery.htm
and send me errors you may (or rather hopefully WILL NOT) be getting.
What's supposed to happen: the page displays an orange swf file with a
dynamic text field.
When you click the button at the
I can't believe no one else has seen this? I've tried to isolate the
problem but so far, it's pretty consistent.
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/
TR/html4/strict.dtd
script type=text/javascript src=jquery-1.3.2.min.js/script
$('.item').click(function(){
$('#slider').animate({ // this element is inside another DIV
that
has CSS overflow:hidden;
no, you should normally be able to use javascript and jquery whereever
you want.
you probably aren't addressing your frames/iframes correctly.
On Jul 20, 9:16 am, Spiatrax vedran.vuce...@gmail.com wrote:
Ok, i got problem. When i load some page with jquery ajax i cant use
javascript on loaded
you should separate the nav links from the image collection, i.e.
place the images in one container and the anv anchors outside of it;
that way you won't run into problems with siblings that aren't images.
I did this:
$('body').append('iframe name=myFrameName3 src='... etc...
now I want to attach a click event to something inside that frame.
Does anyone know why the context parameter of the click() below does
not work? I can't get the alert to show up.
$('#someDiv',
$('#someDiv', top.frames['myFrame'].document)
doesn't return anything, what am I doing wrong?
I think you're going down the wrong path - you shouldnt need to script
anything to get a CSS attribute to work.
usually when I run into this problem it is because somewhere in my
document tree there is a parent lement that has no height attribute
set.
So if you have html someDiv anotherDiv
it ended up being quite easy actually:
$('#'+self.name, top.document).hide();
usually whenever I try to so something and it requires more than 1
line of code it's my fault, not jquery's...
If i want to do something in a parent frame, I would do this:
$('#myDiv', top.document).hide();
but what about this following scenario? I'm inside a frame that was
created like so:
$('body', top.document).append('iframe id=myiframe/iframe');
inside myiframe, I now want to know the id of my
I'm using frames (don't ask) and have exhausted my abilities
(sniff)... here is some pseudo-code to illustrate the situation:
first, CONTAINER.HTM:
script src=jquery.js/script
$(function(){
var module = {
something1 : function(var1){
alert(var2);
}
}
});
thanks - that was an interesting consideration. Unfortunately didn't
make a difference.
(still scratching head)
oh! I got it. thanks Jay, your suggestion gave me the hint I needed to
figure it out.
removing var did 1/2 the trick, the second 1/2 was me realizing that
now I have module as object of the top document, so
top.module.something1('hello');
works.
yay! this drove me crazy last night!
whats the best way to find the frame name of a click event?
in FF I managed to do this:
$('#'+e.view.name, top.document)
but
e.view.name is undefined in IE.
sqrt
I'm totally not getting it... but you might, I hope :)
I appended an iframe:
$('body').append('iframe...etc/iframe');
The iframe source has jquery in the header and it works.
now I want to do something in that iframe, like hide a div. I want to
do this from the top.frame...
$('.myDiv',
I love answering my own ?'s ;P
$('.myDiv', top.frames[0] .DOCUMENT ).hide();
works - forgot to add the document reference.
this has been discussed before, but I'm still hazy:
In FF2 and old Firebug this function ran fine with local files (no
local web server, just straight-up file on local desktop).
Now Firebug complains Access to restricted URI denied code: 1012
$.ajax({
type: POST,
url: myFileName,
I should add that I'm calling just by file name myJsonSource.js -
everything is very local, so I'm not even using any sort of domain
at all, and feel that this should be just fine for running stuff
locally.
Looked at settings to see if there is anything I can turn off...
I downgraded both FF 2 and FB 1.2 so now things work again - but this
sucks! Someone tell those nice folks at Mozilla they should at least
allow a user setting to not get so uptight about script loading
security - I was very surprised to see no ability to adjust that
manually.
except its not a bug - its a feature request...
On Jan 16, 2:39 pm, donb falconwatc...@comcast.net wrote:
By the way, you are 'someone' so you can file a bug report. ;-) -
note smily
On Jan 16, 5:15 pm, jquertil til...@gmail.com wrote:
I downgraded both FF 2 and FB 1.2 so now things
I noticed today after much fiddling that .hide() causes the parent
element to loose its height().
In other words, height() won't work on elements that have display:none
-- causing me to use .hide() only AFTER I've done my .height() - based
calculations.
I suppose that makes sense but I somehow
after searching I found this, which is close but no cigar.
http://plugins.jquery.com/node/3997
I appended an iframe to my document, and use livequery:
$('.LQelements').livequery(function(){...
which works in the top.document, but not in the iframe.
How can I re-use this? I don't want to
$('.LQelements', frames[myIframe].document).livequery(function(){...
doesn't work either :(
alright, this one is a different one... I don't even know what I'm
supposed to be looking for in order to debug this. Below is a Firebug
console error.
Anyone has some insight?
much obliged!
[Exception... Component returned failure code: 0xc1f30001
(NS_ERROR_NOT_INITIALIZED)
.toggler {background:#fff;}
.open {background:#000;}
$('.toggler').click(function(){
$(this).toggleClass('open');
}
It's really a CSS problem, because the DOM does toggle the classname.
But the background does not change.
div class=toggler openblah/div
Only solution I can think of is not
keeping in tradition of answering my own questions, I came up with
this solution but I don't like it much because it's more code. I use
jquery because its supposed to be less code :)
$('.toggler').click(function(){
$(this).toggleClass('open');
$(this).attr('class')=='expander' ?
you're better served using class grouping and setting up your elements
like
div class=tag_cWeb_TSW id=Day01blah/div
then you can select with the class, and the individual elements with
the id attribute, respectively.
aslo, $('#tag_cWeb_TSW_Day*').css('visibility', 'hidden')
that can just be
$('#tag_cWeb_TSW_Day*').hide()
if I have a lot of elements inside div classfull.../div
and then do $('.full').empty().append ('blah');
it takes a long time. Is there a way to speed that up?
thats quite creative thinking, I like it! thanks!
sorry I dont really understand your question, but inter-frame actions
work something like this:
$('#button').click(function(){
$(#divInParentFrame,top.document).remove();
});
read up on jquery's selectors and additional parameters, its all
thanks Karl,
didn't make a difference. I suppose I'll have to preload everything
and show/hide things... ugh.
does empty() go through the entire element node tree and remove things
one by one or something? I kept thinking it just sets innerHTML=''.
I'm checking offset() return values in both events: window resize and
load.
Te offset().left and position().left is 8px more in onload versus
resize.
I tried all options (scroll:false, etc).
window.onresize = checkit();
window.onload = checkit();
function checkit(){
can't use a select box (i.e html SELECT tag) because that is all O/S
based.
you would have to custom-build your popup as divs, position them based
on the element you clicked on and have some conditional statement that
decides whether to pop it at top or bottom of the clicked-on element.
your
you should be able to return the focus() event.
if( $('#navTable').focus() == true )
might need to play with the selector to get it right.
That was my first thought, too, and it's been mentioned before on this
list. I always set margin and padding of html and body to 0;
its really a javascript question...
The 3 parameters var1, var2, var3 that are used my my new Function -
I'd like to be able to do this using an array. After an hour on the
web I haven't been able to find a way...
var fn = new Function( 'var1','var2','var3', func);
your page throws a few errors and I didn't see jquery being loaded,
only some plugins.
'input','textarea' == this would try to find INPUT tags inside a
context of TEXTAREA tags.
you want:
'input, textarea' == remember the jquery selectors behave like CSS
selectors.
you're looking at pretty much completely re-architecting your app. I
originally thoguht ajax-loading scripts and css is a no-brainer, but
discovered it's kind of a hassle, though certainly doable.
$all = $('.listing .myDivs');
$all.get(0).css('color','#339900');
why would this throw an error function css does not exist ??
I tried this too with no luck:
$('.listing .myDivs').get(0).css('color','#339900');
Hello... this has to be something poeple have done before. I managed
to only do about half of what I intended to - I'm stuck in the middle
(seee //comment).
I got a list of stuff and want to be able to select items using the
arrow keys.
ol
li class=itemblah/li
...etc...
I've bound key events
I would have guessed he was looking for something like google maps
zoom (with scrollwheel support). I haven't seen one of those...
ok fine so I use a class - still having the same lack of
understanding: how do I get the contents of the CSS class into a
variable?
huh. this is an interesting thought. why would the use of join() speed
things up versus just appending a string variable?
the reason I'm not concerned about the for() loop is that it seems to
be quite fast when I output the strHTML in a document.write.
I'm trying to figure out wasy to speed up
they thanks for the reply. I don't fully understand what the
parameters in this line do exactly. why is variable in 'quotation'
marks?
fn = new Function( 'variable', code );
thanks!
On Jul 8, 4:03 pm, Michael Geary [EMAIL PROTECTED] wrote:
OK, try this. It's the same idea as the code I
#myDiv {height:200px;background: #FF9900;}
$('#myDiv').css(height'); // returns 200px'
but how can I get the whole enchilada so I have it in a nice and neat
object?
I imagine something like this:
$myCSS = $('#myDiv').css();
$('.otherDivs').css( $myCSS);
$(p).hover(function(){
$(this).addClass(hover);
},function(){
$(this).removeClass(hover);
});
this is kind of a verbose way of swapping classes, isn't it?
I imagine it would not add much to the lightweightness of jquery if it
allowed something like:
$(p).hoverSwap(hover);
or, if more
I searched the group for this and came across my own old post (http://
groups.google.com/group/jquery-en/msg/18d7fa95c5f01d2d)
I've noticed that when displaying a large number of elements into a
page, it takes a bit of time to render.
but in order to use document.write, I would have to write to
posting all code would be crazy but here is relevant snippets.
First the loop I use to iterate ofer an array and write some stuff
into a bunch of DIV elements.
I then want that tho show up someplace on my page. iframe and
document.write displays 500 items basically instantly.
the html() to div
okay i hope no one flames me for posting something thats really about
javascript, but then again my toiling is ultimately geared towards a
jquery plugin, so maybe you will forgive me...
the code sample below uses a prototype function that searches an
array. There is a sampe array, and then I am
thanks for the answer Mike. I probably wasn't very clear.
I'm trying to make the loading happen as part of
blah.something(variable).
something kinda like this:
var blah ={
dynaLoad : function(variable){
$.getScript('alert.js',variable) // the script would simply
contain the line
the other day was told latest jquery now includes dimensions plugin
but I was certain it does not... I still assume it does not, thus I
compile the dimensions plugin into my standard jquery deployments...
can anyone shed light on this? thanks.
excellent!
Yes, Dimensions is completely a part of jQuery as of jQuery 1.2.6.
not knowing your actual HTML I would try something like this:
$('.equipment a.i-right1:gt(0)').each(function(){
$(this).hide();
});
loops over the colletion of your tabs or whatever it is except the one
that has index 0. read up jquery docs on each() and :gt() for details
.
var blah = {
something : function(variable){
alert(variable);
},
something_else : 'hello'
}
alert( blah.something_else() ); // 'hello'
blah.something('whatsup'); // 'whatsup'
so far nothing unusual... but... how can I put the blah.something
function into a separate .js file and
gotta do .each() - look it up in documentation
$('div').each(function(){
$(this).toggle(...etc...)
});
wouldn't it make sense to combine the livequery functionality with
jquery directly?
the nice thing about jquery is the ability do build elements on the
fly. then why not have event capture natively to all newly created
elements?
trying to do something pretty simple:
1. build a list from an ajax request
2. build a sub-list for the list item on click. this is also made via
ajax request
Clearly, we're talking recursion here, since I'd lik to get away with
just one single function that is kind of a template. All I pass to
you don't need the click() function. toggle() does that for you already
according to jquery documentation I should be able to select an
element that is NOT something, i.e. exclusion.
DOM:
divhello spanthere, how are/span you?/div
JQUERY SELECTOR:
$('DIV :not(SPAN)')
SHOULD RETURN:
divhello you?/div
right? well, it's not happening for me... what am I dogin
dude, that's a totally sweet plugin.
Hello...
short version: how do I exclude an element in my selector expression?
long version:
you know those checkboxes in windows where you can actuyally click the
label to check the box?
I'm recreating this with a toggle() like this:
DIV id=CheckContainerINPUT type=checkbox id=Check/ Click
OK I tried my own anticipated solution after looking at some comment
from The Man Himself, but didn't work.
$(#CheckContainer:not(#Check)).toggle(...); --- does not work. stil
can not click the checkbox :(
Ah, yes, livequery looks nice. Thanks.
I'm really trying to get away without any plugins however.
Is livequery the only option for binding events to ajax-loaded DOM
elements?
All the suggestions so far would require the event handler to reside
inside the function that loads the new DOM
Hello...
I'm creating an input element like this:
$(this).after('input type=text name=symptom
value=Enter Symptom class=focusClear/
');
then I want to clear the value on focus like so:
$('.focusClear').focus(function(){
I'm at the end of my rope and REALLY hope someone knows how to address
this:
got some JSON like so:
var Data= {
Music :
[
{Band:The Beatles,Title:Hey Jude},
{Band:The Beatles,Title:Help!},
]
}
And I'm simply looping over it like so:
$(Data.Music).each(function(i){
I just posted something around problems with IE counting an object
variable size differently than FF does.
I dont know how to fix it without changing the $.each() statement with
a for() loop.
for(i=0; iJ.length-1; i++){
I just posted something around problems with IE counting an object
variable size differently than FF does.
I dont know how to fix it without changing the $.each() statement with
a for() loop.
for(i=0; iJ.length-1; i++){
assuming your hover links also have a class name like tip, and your
JSON is set like a proper variable named, say, allTolltips, it
probably will look something like this:
$('.tip').hover(
function(){
if( allTooltips.items.id) == $(this).attr('id') )
{showToolTip();}
},
function(){
Karl, thanks -- that's nice but its got the same problem: the length
of the object is 1 item larger in IE than it is supposed to be.
I wonder why jquery adds an extra empty item into the object?!
, jquertil [EMAIL PROTECTED] wrote:
Karl, thanks -- that's nice but its got the same problem: the length
of the object is 1 item larger in IE than it is supposed to be.
I wonder why jquery adds an extra empty item into the object?!
dont forget TBB, temporary bracket-blindness :)
hello... I cant seem to solve this on my own.
I've built a little tooltip hover widget that remains open even on
mouseout so as to allow the mouse to click inline links etc. but it
does not disappear when the mouse just moves off the span id=tools
I think the code below is totally wrong
not sure if my problem actually can be solved - it might be to
inconsistent with the event logic of any programming language... bt
anyhow, here goes:
1. a mouse rolls over an element, firing the mouseover event.
2. the action bound to the mouseover executes
3. the mouse rolls off the element,
I use this extension code to make a hover tooltip. I want the tooltip
(a div with position:absolute) to display on top of the hovered
element. This works great.
But when moving the mouse, the mouseout and mouseover events are being
fired all the time, causing a flicker effect.
How do I escape
you want to ook into the getScript() function. the SCRIPT tags arent
interpreted by jquery, so you have to load the script separately.
On Mar 27, 4:10 pm, echobase [EMAIL PROTECTED] wrote:
I'm loading a div using this .ajax function:
$.ajax({
type: GET,
contentType: html,
url:
I have had so many problems of similar sort with select's that I
finally gave up and now I just use a library to generate a select box
that's got only DIV tags. That way I can have multi-line items,
tooltips, fading, etc...
death to select input form tag :P
especially I see google using similar
thanks Karl, but you see, I thought I circumvent the issue by actually
having loaded the new content into an invisible DIV already. hence
lis line:
$('#tab_1').html( $('#tabcontent_1').html() );
it's moving the contents of the invisible DIV into the tab DIV.
scratching head still...
I'm befuddled... my hover effects work only during initial load -when
content is reloaded via click() - the hover stops working.
// First, I populate a tab box with the contents of a hidden div
$('#tab_1').html( $('#tabcontent_1').html() );
// inside tabcontent_1 I am doing hover business on
/* rant */
oh man, lemme tell you something... cross-browser display for
scrolling grids is a NIGHTMARE. either you end up doing a zliilion
lines of old-school JS coding to get the table rewritten on the fly,
which slows down rendering-time a LOT, or you end up loosing column
header alignment,
I have this code shown below - it works fine but I imagine there is a
neater way to accomplish this... anyone?
I would love to somehow shrink this to less lines of code.
stoggle = 0;
$(#button).).click(function(){
var extra = 150;
if(stoggle==0){
been reading other posts about $(this) and what it refers to.
And still I dont understand.
I thought $(this) is a refernce to the object I am operating on, no?
So this (no pun intended, tee hee) should work ,I thought:
$('#div').animate({top:parseInt($(this).css('top'))+50},400);
because my
hello...
I'm using the dimensions plugin. I'm using UL, LI to generate a
scrolling grid.
#datatableHead ul has my column headers
#datatable is a div that's scrollable
first I set widths for the head and scroller:
$('#datatableHead ul, #datatable').css({width: $(window).width()-20});
then I
sounds like you want $.getscript(blah.js);
On Mar 4, 2:01 pm, Jonny [EMAIL PROTECTED] wrote:
Basically, I have a JavaScript function (let's call the function
displayDiv) that ends up writing a div to the page. If
displayDiv is called within a table cell, the div will be added
and displayed
ugh, I' min the same boat. I hope some of the superstars will
eventually get around to writing more detailed tutorials. been
struggling with extension writing myself.
On Mar 4, 11:09 am, Leanan [EMAIL PROTECTED] wrote:
Ok, I'm really trying to wrap my head around this, and it's irritating
me.
try converting it to a string value
theData.toString();
probably wont work though - maybe better to have the PHP script return
a boolean true or false or 1 and 0 and then making sure your response
type is value.
On Mar 4, 9:43 am, rpupkin77 [EMAIL PROTECTED] wrote:
Hi, I have a simple ajax
you should check out the interface plugin on the jquery site. There is
code sample to show you how that is used.
On Mar 4, 3:44 pm, Diddly Doo [EMAIL PROTECTED] wrote:
I wonder if anyone has some sample code or plugin for moving select
box options up and down using jQuery. Similar to this:
if you look up the docs for $.ajax() function you will see how to pass
variables to the PHP from your calling page.
for example:
$.ajax({
type: POST,
url: some.php,
data: name=Johnlocation=Boston,
success: function(msg){
alert( Data Saved: + msg );
}
});
On Mar 5, 9:18 am,
odd...
when setting css based on variables like shown in subject line, IE and
FF keep firing a document.resize event.
if I use only 1 single attribute inside the {} its fine, but it seems
to have issues with multiple, comma-separated attributes.
anyone else seen this?
this is interesting:
I have a standard function in JS, and call it like so:
document.onmousedown=trackmouse
function trackmouse(){...}
works very nicely.
I tired to make it happen jQuery-style, but no dice.
$(document).mousedown(function(){})
Of course my function is inside an extender
'trackerdiv' as variable to the extension.
make sense?
On Feb 25, 3:33 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
On Feb 25, 7:33 pm, jquertil [EMAIL PROTECTED] wrote:
this is interesting:
I have a standard function in JS, and call it like so:
document.onmousedown=trackmouse
function
after a litle thinking i realized this could be done easier by doing
the opposite, using wrapinner()
tabletr class=headtdgeneric header stuff/td/tr
tr class=maintd id=wrapit/td/tr/table
$('#wrapit').wrapinner('div id=somediv.../div');
yea, that is workable. until you apply it to 100 elements on a page.
document.write is way faster, but only works during an initial page
load.
sigh...
thanks karl...
John,
I had simplified my example, sorry.
From what I gather, wrap() won't work for this kind of table:
tabletr class=headtdgeneric header stuff/td/tr
tr class=main/td...now wrap this.../td/tr/table
John Resig wrote:
I think you want .wrap():
TT thanks a lot! for this - it works.
Interesting comparison: the jQuery version of my dragger is 23 lines
of code inluding all callbacks.
The plain javascript version is 22 lines (but, alas, doesnt require
the jQuery library of course).
I also notice that while dragging, especially in firefox,
if you have problems, take a peek at my XML parsing extension
function. Might not be exactly what you're looking for but it works
for me.
http://jquery-and-javascript.blogspot.com/
loadXML2array: function() {
return this.each(function() {
var data = $.ajax({
thanks again timothy. I decided to keep a blog with workable code
snippets. check it out, y'all :)
http://jquery-and-javascript.blogspot.com/
has anyone had the following problem before?
VERSION 1 =// works in IE and FF
myFunction(){
...
}
document.onmousedown=myFunction;
VERSION 2 =// works in IE but not in FF
jQuery.fn.extend({
myFunction: function() {
...
}
});
1 - 100 of 110 matches
Mail list logo