[jQuery] Re: a problem when using django template and jquery

2009-12-17 Thread elprup
I check it and find that it's my mistake. When I use JSON dictionary
structure to submit, and read it like:
for item in dictionary
so the sequence which is written to database is not kept. When I use
data to render, the problem came out.

thanks, Karl.

On 12月15日, 下午11时12分, Karl Swedberg k...@englishrules.com wrote:
 are you sure that the tr IDs are being rendered in the right order?  
 View source to double check. If they are correct in the html, could  
 you point us to a test page where you're experiencing the problem?

 thanks,

 --Karl

 
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Dec 15, 2009, at 3:47 AM, elprup wrote:



  hello guys, I use django template to generate a HTML like this:

 {% for type in types %}
 tr id=list_{{type.id}} class=itemrow
   td width=70 align=middle class=list_typename
  {{type.name}}/td
 /tr
 {% endfor %}

  typeid increases from 1 by 1.

  I use class traverse to get the sequence of the list:

   sendstr = ;
   $(.itemrow).each(function(index, value) {
 type = $(this).attr('id').substring(5);
 sendstr += type;
});

  I expect sequence to be like 12345, but the result is 13254. I'm
  confused.

  Can anyone help me. Thanks


[jQuery] Re: (validate)

2009-12-17 Thread eimantas
Here how it looks now:

validator : $('#new_place').validate({
  errorElement: 'p',
  errorPlacement: function(error, elem) {
error.addClass('error-message left');
if (elem.attr('id') != 'select_id') {
  elem.parent('span').after(error);
} else {
  elem.parents('div.line.categories').append(error);
};
  },
  meta: 'validate',
  debug: true,
  onsubmit: false,
  highlight: function(element, errorClass) {
if ($(element).attr('id') != 'select_id') {
  $(element).parents('div.field-wrapper').addClass('errors');
  if ($(element).parent('span').next().length  0) {
$(element).parent('span').next('p.error').addClass('error-
message left');
  };
} else {
  $(element).parents('div.line.categories').prev
('div.line').addClass('errors'); // red label
  $(element).parents('div.line.categories').addClass
('errors'); // red error
};
  },
  unhighlight: function(element, errorClass) {
if ($(element).attr('id') != 'select_id') {
  $(element).parents('div.field-wrapper').removeClass
('errors');
} else {
  $(element).parents('div.line').removeClass('errors');
  $(element).parents('div.line').prev
('div.line.errors').removeClass('errors');
};
  }
}),

and as soon as i add errorClass: 'error-message left' to the validator
configuration - messages start piling up.

On Dec 16, 6:29 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 Without seeing any of your code is pure guesswork to help you find the
 issue. I need to see at least the code configuring the validation plugin.

 Jörn

 2009/12/16 eimantas enc.c...@gmail.com

  Hi guys

  I'm having trouble with validation plugin from bassistance.de. I have
  custom handlers for errorPlacement, highlight and unhighlight events.
  I also have defined custom errorElement. Error messages and validation
  data is extracted via metadata plugin using html5 data-* attributes.

  The problem is that if I define custom errorClass (which i need for
  error message elements), the error gets added each time the field is
  unfocused and left blank after first validation. For example:

  1) I open form and try to submit it;
  2) Errors are displayed;
  3) I focus/blur errored field;
  4) the error for that field is added again;

  Any help would be appreciated without disclosing lots of mine code .)

  Thank you in advance for taking time to answer my call for help!


[jQuery] prompt before closing dialog

2009-12-17 Thread Obi1
Hi, i'm having some trouble because i'm using a dialog witch has a
form in it where someone can change info about their hotel. this
dialog also has 2 buttons one to close and the other to save changes.
what i'm trying to accomplish is - when someone made sany change and
tries to close de dialog without saving he will be prompt if he really
wants to leave without saving the changes an the dialog only closes if
person choses 'yes'.

when closing the window clicking the 'close' button i can accomplish
this, but i wanted it also to work when closing dialog using the x
button on the top of the dialog.

is this possible?


Re: [jQuery] prompt before closing dialog

2009-12-17 Thread Dhruva Sagar
If you provide your function for the close event you should be able to
achieve this.
It should return false in case you don't want it to close (in my opinion)

Thanks  Regards,
Dhruva Sagar.




On Thu, Dec 17, 2009 at 3:40 PM, Obi1 gurreiro_fa...@yahoo.com.br wrote:

 Hi, i'm having some trouble because i'm using a dialog witch has a
 form in it where someone can change info about their hotel. this
 dialog also has 2 buttons one to close and the other to save changes.
 what i'm trying to accomplish is - when someone made sany change and
 tries to close de dialog without saving he will be prompt if he really
 wants to leave without saving the changes an the dialog only closes if
 person choses 'yes'.

 when closing the window clicking the 'close' button i can accomplish
 this, but i wanted it also to work when closing dialog using the x
 button on the top of the dialog.

 is this possible?



Re: [jQuery] prompt before closing dialog

2009-12-17 Thread Richard D. Worth
Handle the beforeclose event and return false if you don't want to allow the
dialog to close yet:

http://docs.jquery.com/UI/Dialog#event-beforeclose

If you have any further questions, there's a separate list for questions
about jQuery UI plugins:

http://groups.google.com/group/jquery-ui

- Richard

On Thu, Dec 17, 2009 at 5:10 AM, Obi1 gurreiro_fa...@yahoo.com.br wrote:

 Hi, i'm having some trouble because i'm using a dialog witch has a
 form in it where someone can change info about their hotel. this
 dialog also has 2 buttons one to close and the other to save changes.
 what i'm trying to accomplish is - when someone made sany change and
 tries to close de dialog without saving he will be prompt if he really
 wants to leave without saving the changes an the dialog only closes if
 person choses 'yes'.

 when closing the window clicking the 'close' button i can accomplish
 this, but i wanted it also to work when closing dialog using the x
 button on the top of the dialog.

 is this possible?



Re: [jQuery] Re: Styling dynamic content

2009-12-17 Thread Richard D. Worth
Works for me:

http://jsbin.com/egoto/

- Richard

On Wed, Dec 16, 2009 at 8:44 PM, Jason Kaczmarsky jkaczmar...@yahoo.comwrote:

 Yes, I am sure they are the correct class and are showing up properly.

 Button press:
 //loop
 $(#files).append('div class=file'+Files[i]+'/div');
 //end loop

 Firebug:
 div id=files style=display: block;
 div class=filework.txt/div
 div class=fileSAS Guide.txt/div
 /div

 On Dec 16, 7:43 pm, Smith, Allex allex.sm...@chelanpud.org wrote:
  The browser should render all the styles no matter when they enter.
 
  Are you sure that the class is assigned to those elements? I would make
 sure by peeking at the rendered html via Firebug.
 
  -Original Message-
  From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
 Behalf Of Jason Kaczmarsky
  Sent: Wednesday, December 16, 2009 2:14 PM
  To: jQuery (English)
  Subject: [jQuery] Styling dynamic content
 
  So I've created a little app which loads some filenames into a div via
  an AJAX query. This happens when a user clicks a button, not when the
  page loads. Because of this, I cannot style the filenames how I want.
  I've tried using CSS to do the trick:
 
  .file{
  color: #F00;
  }
 
  .file:hover{
  cursor:pointer;
  color:#000;
  }
 
  This CSS colors the filenames red when it loads, but nothing in the
  hover event works.
 
  Instead of this, I tried using jQuery to style it.
 
  $(.file).hover(function(){
  $(this).css(background-color,#F00);
  },function(){
  $(this).css(background-color,#000);
  });
 
  This also does not change anything. I assume it is because the element
  does not exist when the page is rendered, but later on. Although this
  doesn't explain why the text is red when I use the CSS, so I'm a bit
  confused. How would I accomplish this?



[jQuery] Re: prompt before closing dialog

2009-12-17 Thread Obi1
this doesn't seem to work, i mean the prompt appears but only after
dialog is closed;
also tryed using the beforeclose event but the prompt doesn't even
show.


Re: [jQuery] traversal question for IE6 and IE7

2009-12-17 Thread Richard D. Worth
Your html isn't valid.
* A dl cannot contain a div directly as you've shown, only dts and dds.
* The dt and dd elements inside the div#bar need to be directly inside the
dl. They can't have a div as a parent.
* The dt and dd elements don't close immediately when you put a closing
slash in the opening tag. If you want to have them be empty and close them
immediately, change

dt /

to

dt/dt

otherwise the browser ignores the slash in the opening tag and waits for
some parsing rule to close the element. For more on that, see
http://groups.google.com/group/jquery-en/browse_thread/thread/bef63592011861ba

By the time the browser's html parser is done with it, your html might look
something like this:

div id=foo
  dl
dt
  div id=bar/div
/dt
dt/dt
dd/dd
dt/dt
dd id=baz/dd
  /dl
/div

which based on the html you've shared is a lot different than what you
started with.

- Richard

On Wed, Dec 16, 2009 at 6:39 PM, cewing cew...@u.washington.edu wrote:

 Hi all,  I've got a bit of HTML with the following structure:

 div id=foo
  dl
dt /
div id=bar
  dt /
  dd /
  dt /
  dd id=baz/
/div
  /dl
 /div

 in IE6 and IE7 $(dd#baz).parents() returns an object with 2 nodes in
 it, the dl and div#foo.  it does not contain div#bar.  I assume this
 is due to a stricter interpretation of proper DOM structure in IE6 and
 IE7 than in FF, Safari, Chrome, Opera, or even IE8 (where div#bar _is_
 present).

 I need to find div#bar.  Can someone suggest a traversal-based
 workaround to getting there from dd#baz that will work in IE6 and
 IE7?  The problem with non-traversal based solutions is that the
 entire structure you see here may be nested inside each of the dd
 elements, and if so, I'd need to find the div#bar _closest_ in the
 parents hierarchy to the dd from which I begin.

 If absolutely necessary, I can scrap dl structure and go with a more
 pure div-based structure, but I'm trying to hook into some automatic
 styling in my chosen framework and that is hung on dl elements.

 Any suggestions?



Re: [jQuery] Re: prompt before closing dialog

2009-12-17 Thread Richard D. Worth
Here's an example of using a confirm inside beforeclose

Demo: http://jsbin.com/urosa

Source: http://jsbin.com/urosa/edit

- Richard

On Thu, Dec 17, 2009 at 5:30 AM, Obi1 gurreiro_fa...@yahoo.com.br wrote:

 this doesn't seem to work, i mean the prompt appears but only after
 dialog is closed;
 also tryed using the beforeclose event but the prompt doesn't even
 show.



[jQuery] Re: prompt before closing dialog

2009-12-17 Thread Obi1
it doesn't work for me as i'm using jConfirm not javascript confirm
but it will have to do while i don't find a solution.

Thanks


[jQuery] Jquery does not work in IE8

2009-12-17 Thread blueshift
Jquery-1.3.2. runs fine in Safari and Firefox. In IE8 (using the
Developer Tools), I get the error: Could not get the position
property. Invalid argument jquery-1.3.2.js, line 12 character 12949.
Using debugging, the script highlights the characters {J[G]=K}.

I have no idea what this does, but it seems to cause the problem! The
result is when a thumbnail image is clicked in one of my galleries,
the image does not open in IE8. If anyone understands this or how to
correct it, I'd be very grateful!

See the problem in action (or not) on my website: www.blueshiftgallery.com
(click on a gallery to open the thumbnails).

Many thanks!


[jQuery] Superfish dropdown shows only inside containing li

2009-12-17 Thread Eelco
Hi,

I am using superfish in a Joomla template, and it works fine in all
browsers including IE6 and IE8, not in IE7 however. I do not have any
positioned elements, its just that it seems as if the containing li's,
have overflow:hidden, which they don't have. I can see that it works
in IE7 because I have applied small negative margins, so a small piece
of the dropdown actually appears inside the containing li

I would provide you with a link, however I prefer to do so privately
if needed.

My code:
div id=menu
  ul class=menu sf-menu sf-js-enabled sf-shadow
li class=parent item10
  a class=sf-with-ul href=/nwg/index.php?
option=com_contentview=categorylayout=blogid=7Itemid=10
spanVisie/span
span class=sf-sub-indicator »/span
  /a
  ul style=display: none; visibility: hidden;
li class=item19
  a href=/nwg/index.php?
option=com_contentview=categorylayout=blogid=8Itemid=19
spanStrategie/span
  /a
/li
  /ul
/li
  /ul
/div

CSS:
#menu ul {
list-style-type: none;
padding-left:15px;
}

#menu li {
display:block;
float:left;
padding:2px 0;
height:23px;
}

/* Opacity, exclude IE6 */
htmlbody #menu ul li {
filter:alpha(opacity=70);
opacity: 0.7;
}

/* Firefox children inherit transparency, IE children don't */
htmlbody #menu ul li li, x:-moz-any-link {
filter:alpha(opacity=100);
opacity: 1;
}

htmlbody #menu ul li#current li {
filter:alpha(opacity=70);
opacity: 0.7;
}

#menu li#current {
filter:alpha(opacity=100);
opacity:1;
font-weight:bold;
}

#menu ul li ul {
width:150px;
}

#menu ul li li {
padding-left:10px;
}


/* This output is overriden for all except IE6 */
#menu ul li li {
width:150px;
}

htmlbody #menu ul li li {
width:inherit;
}

/* IE6 Hack */
#menu ul li { width:42px; }
htmlbody #menu ul li {
width:auto;
}

htmlbody .separator {
margin-right:13px;
}

#menu ul li ul {
padding: 0;
margin-top: -10px;
margin-left: -17px;
}

#menu a {
text-decoration:none;
color: white;
font-size:10pt;
}

span.separator {
display:block;
margin-top:-2px;
margin-left:18px;
height: 27px;
border-left:1px solid white;
}

Last but not least, Superfish CSS: (I have only disabled two padding
styles)

/*** ESSENTIAL STYLES ***/
.sf-menu, .sf-menu * {
margin: 0;
padding:0;
list-style: none;
}
/*.sf-menu {
line-height:1.0;
}*/
.sf-menu ul {
position:   absolute;
top:-999em;
/*width:10em; /* left offset of submenus need 
to match (see below)
*/
list-style: none;
}
.sf-menu ul li {
width:  100%;
list-style: none;
}
.sf-menu li:hover {
visibility: inherit; /* fixes IE7 'sticky bug' */
}
.sf-menu li {
float:  left;
position:   relative;
height: 23px;
}
.sf-menu a {
display:block;
position:   relative;
}
.sf-menu li:hover ul, .sf-menu li#parent:hover ul,
.sf-menu li.sfHover ul {
left:   0;
top:2.5em; /* match top ul list item height */
z-index:99;
}
ul.sf-menu li:hover li ul, .sf-menu li#parent:hover ul,
ul.sf-menu li.sfHover li ul {
top:-999em;
}
ul.sf-menu li li:hover ul,
ul.sf-menu li li.sfHover ul {
/*left: 10em; /* match ul width */
top:0;
}
ul.sf-menu li li:hover li ul,
ul.sf-menu li li.sfHover li ul {
top:-999em;
}
ul.sf-menu li li li:hover ul,
ul.sf-menu li li li.sfHover ul {
/*left: 10em; /* match ul width */
top:0;
}

/*** DEMO SKIN ***/
.sf-menu {
float:  left;
margin-bottom:  1em;
}
.sf-menu a {
/*border-left:  1px solid #fff;*/
/*border-top:   1px solid #CFDEFF;*/
height: 23px;
xpadding:   0 1em; /* ET: DISABLED, IE6 DID NOT LINE OUT 
PROPERLY
14-12-2009 */
}
.sf-menu a, .sf-menu a:visited  { /* visited pseudo selector so IE6
applies text colour*/
color:  #13a;
}
.sf-menu li {
/*background:   #BDD2FF;*/
}
.sf-menu li li {
background: #2ea2da;
filter: alpha(opacity=70);
opacity:0.7;
}
.sf-menu li li li {
background: #9AAEDB;
}
.sf-menu li:hover, .sf-menu li.sfHover,
.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
/*background:   #CFDEFF;*/
outline:0;
}

/*** arrows **/
.sf-menu a.sf-with-ul {
xpadding-right: 2.25em; /* ET: DISABLED, 

[jQuery] Superfish, menu out of screen

2009-12-17 Thread jonas
Hi!

Is is possible to check if a new UL is rendered outside the browser
window?

When using Superfish with default settings, UL's can get rendered
outside the browser window if we have manu child levels, which just
enables the browser scroll. We would for example like the UL to be
rendered to the left, instead of on the right.

Any thoughts?

Regards
Jonas


[jQuery] Can't pull xml page from rss feed?

2009-12-17 Thread Eli Luong
I set up some code like below:

$.ajax({
type: GET,
url: sample2.xml,
dataType: xml,
success: function(xml) {

And I took the xml source from my rss feed here: 
http://apamsa.blogspot.com/rss.xml

It works fine at parsing through the xml file if I save the xml code
offline, but when I replace the url with the actual url, it doesn't
work anymore. Can you advise where I can start looking to figure out
why it's not working correctly?

Thanks.


[jQuery] Jquery Splitter problem

2009-12-17 Thread adil
hello everyone,
   i used jquery to create a splitter.it's working fine
with every browser except Netscape.can you please fix the issue.i am
attaching a few screen shots as to what happens to it in a netscape
browser...waiting for your reply in anticipation ...thank you


[jQuery] Fwd: Urgent - Harper killing Copenhagen

2009-12-17 Thread Jonny Miller
-- Forwarded message --
From: Ricken Patel - Avaaz.org av...@avaaz.org
Date: Wed, Dec 16, 2009 at 11:13 AM
Subject: Urgent - Harper killing Copenhagen
To: presidentand...@gmail.com presidentand...@gmail.com


 Dear friends,



http://www.avaaz.org/en/harper_enough_is_enough?cl=405287903v=4944 *Canada
is blocking crucial UN climate negotiations in Copenhagen* and secretly
rolling back our efforts to fight climate change. A massive national outcry
has stopped Harper before, *the planet needs us now:*

[image: Sign The
Petition!]http://www.avaaz.org/en/harper_enough_is_enough?cl=405287903v=4944
*Enough is enough. As the world mounts a desperate effort to stop
catastrophic global warming in Copenhagen, Canada should be leading the way.
Instead, we're receiving global fossil awards for wrecking this crucial
summit*! And new leaked documents show that while the entire world is
increasing cuts to carbon emissions, the government is secretly planning
roll back ours.

At the Bali climate summit in 07, a massive national outcry forced Harper to
stop blocking the talks. But the oil companies that PM Harper works for know
that *Copenhagen is the make or break moment* for climate. It will not be
easy to win this time, but to save the planet and our country we have to.

Let's mount a tidal wave of pressure on Harper with *the largest petition in
Canadian history - click below to sign, and forward this email to everyone:*

http://www.avaaz.org/en/harper_enough_is_enoughhttp://www.avaaz.org/en/harper_enough_is_enough/?cl=405287903v=4944

*The petition will be delivered directly* to the Canadian delegation in
Copenhagen as Harper arrives this week, and names of the signers will
actually be read out in the summit hall. The Canadian delegation has become
the object of international disbelief and ridicule in Copenhagen, but we can
show the world that the Canadian people still hold our values of being good
neighbours and global citizens.

*Harper is undermining our deepest values and proudest traditions.* But this
is about more than our reputation. Studies show that climate change is
already taking up to 300,000 human lives a year through turning millions of
farms to dust and flooding vast areas. *We can no longer allow Harper to
make us responsible for these deaths,* or put Canada's economic future in
jeopardy by sacrificing our green competitiveness for a brown economy based
on the dirtiest (tar sands) oil in the world.

Copenhagen is seeking the biggest mandate in history to stop the greatest
threat humanity has ever faced. History will be made in the next few days,
and our country is the problem, not the solution. *How will our children
remember this moment? Let's tell them we did all we could.*

With hope,

Ricken, Laryn, Anne-Marie, Iain and the Avaaz Canada team

More information at these sites:
CBC -- Tories pondered weaker emission targets for oil and gas:
http://www.cbc.ca/canada/story/2009/12/14/greenhouse-gas-emissions.html

Mail and Guardian -- Canada's climate shame:
http://www.mg.co.za/article/2009-12-04-canadas-climate-shame

Toronto Star -- Who are the Yes Men and why did they punk Canada at
Copenhagen:
http://www.thestar.com/news/world/article/738933--who-are-the-yes-men-and-why-did-they-punk-canada-at-copenhagen

Macleans -- Suddenly the world hates Canada:
http://www2.macleans.ca/2009/12/15/suddenly-the-world-hates-canada/3/

Fossil of the Day Awards: http://www.fossiloftheday.com/

--


*Want to support Avaaz?* We're entirely funded by donations and receive no
money from governments or corporations. Our dedicated online team ensures
even the smallest contributions go a long way -- donate
herehttps://secure.avaaz.org/en/donate_to_avaaz
.


*ABOUT AVAAZ* Avaaz.org is an independent, not-for-profit global campaigning
organization that works to ensure that the views and values of the world's
people inform global decision-making. (Avaaz means voice in many
languages.) Avaaz receives no money from governments or corporations, and is
staffed by a global team based in Ottawa, London, Rio de Janeiro, New York,
Buenos Aires, and Geneva. Click
*here*http://www.avaaz.org/en/report_back_2/to learn more about our
largest campaigns.
*Don't forget to check out our Facebook http://www.facebook.com/Avaaz and
Myspace http://www.myspace.com/avaazorg and
Bebohttp://www.bebo.com/Avaazpages! You can also follow Avaaz on
Twitter! http://twitter.com/Avaaz*

You are getting this message because you signed CONGRESS: NO BLANK CHECK
FOR WALL STREET http://www.avaaz.org/en/wall_street_bailout on 2008-09-25
using the email address presidentand...@gmail.com. To ensure that Avaaz
messages reach your inbox, please add av...@avaaz.org to your address book.
To change your email address, language settings, or other personal
information, click here:
https://secure.avaaz.org/act/index.php?r=profileuser=aeba3c96a4bb6071c0d36fd105a20ec2lang=enor
simply click
here to 

[jQuery] Fwd: Jquery Splitter problem

2009-12-17 Thread adil hafiz
hello,
 i am the same guy with the Jquery splitter problem.i am
sending you some screen shotsso that you can get a feel of what i
want to show you..thank you


Re: [jQuery] Re: prompt before closing dialog

2009-12-17 Thread Richard D. Worth
The built in browser confirm is the only way you can block (with for the
user to respond) without blocking the UI. Any javascript confirm will have
to use a callback instead of a return false. In that case you can return
false to prevent the close, then use the result of the jConfirm callback to
decide whether or not to call .dialog('close') manually. But you'll use a
flag to prevent an infinite loop.

- Richard

On Thu, Dec 17, 2009 at 6:44 AM, Obi1 gurreiro_fa...@yahoo.com.br wrote:

 it doesn't work for me as i'm using jConfirm not javascript confirm
 but it will have to do while i don't find a solution.

 Thanks



Re: [jQuery] Superfish, menu out of screen

2009-12-17 Thread Charlie




this thread should help
http://groups.google.com/group/jquery-en/browse_thread/thread/255652615420722c/093dd27ff7f2e7b3?lnk=gstq=superfish+onbeforeshow#093dd27ff7f2e7b3

jonas wrote:

  Hi!

Is is possible to check if a new UL is rendered outside the browser
window?

When using Superfish with default settings, UL's can get rendered
outside the browser window if we have manu child levels, which just
enables the browser scroll. We would for example like the UL to be
rendered to the left, instead of on the right.

Any thoughts?

Regards
Jonas

  





Re: [jQuery] Superfish dropdown shows only inside containing li

2009-12-17 Thread Charlie




have you tried disabling the superfish.js and let menu operate in css
only mode? not sure how anyone can help without a link

Eelco wrote:

  Hi,

I am using superfish in a Joomla template, and it works fine in all
browsers including IE6 and IE8, not in IE7 however. I do not have any
positioned elements, its just that it seems as if the containing li's,
have overflow:hidden, which they don't have. I can see that it works
in IE7 because I have applied small negative margins, so a small piece
of the dropdown actually appears inside the containing li

I would provide you with a link, however I prefer to do so privately
if needed.

My code:
div id="menu"
  ul class="menu sf-menu sf-js-enabled sf-shadow"
li class="parent item10"
  a class="sf-with-ul" href=""
spanVisie/span
span class="sf-sub-indicator" /span
  /a
  ul style="display: none; visibility: hidden;"
li class="item19"
  a href=""
spanStrategie/span
  /a
/li
  /ul
/li
  /ul
/div

CSS:
#menu ul {
list-style-type: none;
	padding-left:15px;
}

#menu li {
display:block;
float:left;
padding:2px 0;
height:23px;
}

/* Opacity, exclude IE6 */
htmlbody #menu ul li {
filter:alpha(opacity=70);
	opacity: 0.7;
}

/* Firefox children inherit transparency, IE children don't */
htmlbody #menu ul li li, x:-moz-any-link {
filter:alpha(opacity=100);
opacity: 1;
}

htmlbody #menu ul li#current li {
filter:alpha(opacity=70);
	opacity: 0.7;
}

#menu li#current {
filter:alpha(opacity=100);
opacity:1;
	font-weight:bold;
}

#menu ul li ul {
width:150px;
}

#menu ul li li {
padding-left:10px;
}


/* This output is overriden for all except IE6 */
#menu ul li li {
width:150px;
}

htmlbody #menu ul li li {
width:inherit;
}

/* IE6 Hack */
#menu ul li { width:42px; }
htmlbody #menu ul li {
width:auto;
}

htmlbody .separator {
margin-right:13px;
}

#menu ul li ul {
padding: 0;
margin-top: -10px;
margin-left: -17px;
}

#menu a {
text-decoration:none;
color: white;
	font-size:10pt;
}

span.separator {
display:block;
margin-top:-2px;
margin-left:18px;
height: 27px;
border-left:1px solid white;
}

Last but not least, Superfish CSS: (I have only disabled two padding
styles)

/*** ESSENTIAL STYLES ***/
.sf-menu, .sf-menu * {
	margin:			0;
	padding:		0;
	list-style:		none;
}
/*.sf-menu {
	line-height:	1.0;
}*/
.sf-menu ul {
	position:		absolute;
	top:			-999em;
	/*width:			10em; /* left offset of submenus need to match (see below)
*/
	list-style:		none;
}
.sf-menu ul li {
	width:			100%;
	list-style:		none;
}
.sf-menu li:hover {
	visibility:		inherit; /* fixes IE7 'sticky bug' */
}
.sf-menu li {
	float:			left;
	position:		relative;
	height:			23px;
}
.sf-menu a {
	display:		block;
	position:		relative;
}
.sf-menu li:hover ul, .sf-menu li#parent:hover ul,
.sf-menu li.sfHover ul {
	left:			0;
	top:			2.5em; /* match top ul list item height */
	z-index:		99;
}
ul.sf-menu li:hover li ul, .sf-menu li#parent:hover ul,
ul.sf-menu li.sfHover li ul {
	top:			-999em;
}
ul.sf-menu li li:hover ul,
ul.sf-menu li li.sfHover ul {
	/*left:			10em; /* match ul width */
	top:			0;
}
ul.sf-menu li li:hover li ul,
ul.sf-menu li li.sfHover li ul {
	top:			-999em;
}
ul.sf-menu li li li:hover ul,
ul.sf-menu li li li.sfHover ul {
	/*left:			10em; /* match ul width */
	top:			0;
}

/*** DEMO SKIN ***/
.sf-menu {
	float:			left;
	margin-bottom:	1em;
}
.sf-menu a {
	/*border-left:	1px solid #fff;*/
	/*border-top:		1px solid #CFDEFF;*/
	height:			23px;
	xpadding: 		0 1em; /* ET: DISABLED, IE6 DID NOT LINE OUT PROPERLY
14-12-2009 */
}
.sf-menu a, .sf-menu a:visited  { /* visited pseudo selector so IE6
applies text colour*/
	color:			#13a;
}
.sf-menu li {
	/*background:		#BDD2FF;*/
}
.sf-menu li li {
	background:		#2ea2da;
	filter:			alpha(opacity=70);
	opacity:		0.7;
}
.sf-menu li li li {
	background:		#9AAEDB;
}
.sf-menu li:hover, .sf-menu li.sfHover,
.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
	/*background:		#CFDEFF;*/
	outline:		0;
}

/*** arrows **/
.sf-menu a.sf-with-ul {
	xpadding-right: 	2.25em; /* ET: DISABLED, IE6 DID NOT LINE OUT
PROPERLY 14-12-2009 */
	min-width:		1px; /* trigger IE7 hasLayout so spans position
accurately */
}
.sf-sub-indicator {
	position:		absolute;
	display:		block;
	right:			.75em;
	top:			1.05em; /* IE6 only */
	width:			10px;
	height:			10px;
	text-indent: 	-999em;
	overflow:		hidden;
	background:		url('../images/arrows-ff.png') no-repeat -10px
-100px; /* 8-bit indexed alpha png. IE6 gets solid image only */
}
a  .sf-sub-indicator {  /* give all except IE6 the correct values */
	top:			.8em;
	background-position: 0 -100px; /* use translucent arrow for modern
browsers*/
}
/* apply hovers to modern browsers */
a:focus  .sf-sub-indicator,
a:hover  .sf-sub-indicator,
a:active  .sf-sub-indicator,
li:hover  a  .sf-sub-indicator,
li.sfHover  a  .sf-sub-indicator {
	

[jQuery] ajax

2009-12-17 Thread idcoder
i am trying to submit a form using jquery and ajax. The form gets
submitted without going to the url through ajax and values are entered
successfully in DB if all entries are correct and validated. also it
does not updated the DB if any errors.

here is the javascript

$(document).ready(function(){

$('#regist').submit(function(e) {

$.ajax({
type: POST,
url: submit1.php,
data: $('#regist').serialize(),
dataType: json,
success: function(){
$(loading).append(img id='checkmark' 
src='images/check.png' /
);
}
});
return false;
e.preventDefault();

});

});

But i cannot work out the success event in ajax..anything i insert
into success event does not work...any help would be
appreciated..thanks


Re: [jQuery] ajax

2009-12-17 Thread Michael Lawson

Is your selector correct for your success function?

perhaps you meant $(#loading) instead of $(loading)  ?

cheers

Michael Lawson
Development Lead, Global Solutions, ibm.com
Phone:  1-276-206-8393
E-mail:  mjlaw...@us.ibm.com

'When seen from outer space, our beautiful blue planet has no national
boundaries.'

http://www.givesmehope.com/


   
  From:   idcoder idrishlaxmid...@gmail.com  
   
  To: jQuery (English) jquery-en@googlegroups.com  
   
  Date:   12/17/2009 08:15 AM  
   
  Subject:[jQuery] ajax
   





i am trying to submit a form using jquery and ajax. The form gets
submitted without going to the url through ajax and values are entered
successfully in DB if all entries are correct and validated. also it
does not updated the DB if any errors.

here is the javascript

$(document).ready(function(){

 $('#regist').submit(function(e) {

 $.ajax({
 type: POST,
 url: submit1.php,
 data: $('#regist').serialize(),
 dataType: json,
 success: function(){
 $(loading).append(img
id='checkmark' src='images/check.png' /
);
 }
 });
 return false;
 e.preventDefault();

 });

});

But i cannot work out the success event in ajax..anything i insert
into success event does not work...any help would be
appreciated..thanks

inline: graycol.gifinline: ecblank.gif

[jQuery] Re: more ckeditor

2009-12-17 Thread Mean Mike
I haven't played with the samples . CKEDITOR API is well documented is
just the jquery implementation that I'm having trouble with
it seems that you would be right but I do I know when  $
(#fck).ckeditor() returns ?

the problem seems to me that CKedtior.js isn't loaded until $
(#fck).ckeditor() is called so if I call anyhting before that is
finished I get CKEDITOR is undefined.

Mike

On Dec 16, 5:05 pm, Scott Sauyet scott.sau...@gmail.com wrote:
 On Dec 16, 4:07 pm, Mean Mike mcgra...@gmail.com wrote:

  now this works because by the time i press the button the ckeditor is
  load so now I'm trying to figure out when it is load so I can apply
  things to it once its loaded rather than have a user click a button.

 Man, there is a lot of documentation for CKEditor, but it seems hard
 to find one's way around.  Have you played with the _samples folder in
 the distribution?  In _samples/api.html, I found this:

     CKEDITOR.on( 'instanceReady', function(event) {
         // your code here
     });

 My guess is that you can call this as soon as $(#fck).ckeditor()
 returns, but I'm far from sure.

 Good luck,

   -- Scott


[jQuery] Re: How to compare data in 2 jQuery data() elements

2009-12-17 Thread discern
Thanks. I'll give that a go. Otherwise, I'll just write 2 different
functions: one for comparison (I'll probably compare hashes using the
sha1 plugin) and one for sending the data to the backend.


[jQuery] Re: Superfish - let the navigation fade in AND fade out

2009-12-17 Thread decola
I solved the problem on my own. The problem was that the menupoint
hides before it is abel to slide out.

i just changed

var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not
(not).removeClass(o.hoverClass)
.find('ul').hide().css
('visibility','visible');
into

var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not
(not).removeClass(o.hoverClass)
.find('ul').css
('visibility','visible');

no i have another problem, but i will post this in another thread.
thanks so far :)

On 16 Dez., 13:52, decola decola...@googlemail.com wrote:
 I was searching for a plugin that makes me abel to make a dropdown
 navigation. I found Superfish and was really happy. But now i realized
 that then menuepoints fade in but just pop away if the mouse left
 them. I want that the menupoints fade out if the mouse leave them like
 on this page

 http://demo.joomlaextensions.co.in/index.php?option=com_contentview=...

 So i started to recode the code of Superfish, but i can´t get it
 working.

 Heres a small code snippet (the only things i´ve changed)

 sf.defaults = {
                 hoverClass       : 'sfHover',
                 pathClass        : 'overideThisToUse',
                 pathLevels       : 1,
                 delay            : 800,
                 animationShow: {opacity:'show'},
                 animationHide: {opacity:'hide'},
                 speed            : '10',
                 autoArrows       : true,
                 dropShadows  : true,
                 disableHI        : false,               // true disables 
 hoverIntent detection
                 onInit           : function(){}, // callback functions
                 onBeforeShow : function(){},
                 onShow           : function(){},
                 onBeforeHide : function(){},
                 onHide           : function(){}
         };
         $.fn.extend({
                 hideSuperfishUl : function(){
                         var o = sf.op,
                                 not = (o.retainPath===true) ? o.$path : '';
                         o.retainPath = false;
                         var $ul = 
 $(['li.',o.hoverClass].join(''),this).add(this).not
 (not).removeClass(o.hoverClass)
                                 
 .find('ul').hide().css('visibility','visible');
                         sf.IE7fix.call($ul);
                         o.onBeforeHide.call($ul);
                         $ul.animate(o.animationHide,o.speed,function(){ 
 sf.IE7fix.call
 ($ul); o.onHide.call($ul); });
                         //alert(hide !!!);
                         return this;
                 },
                 hideSuperfishUlStartup : function(){
                         var o = sf.op,
                                 not = (o.retainPath===true) ? o.$path : '';
                         o.retainPath = false;
                         var $ul = 
 $(['li.',o.hoverClass].join(''),this).add(this).not
 (not).removeClass(o.hoverClass)
                                         
 .find('ul').hide().css('visibility','visible');
                         o.onHide.call($ul);
                         //alert(hide !!! startup);
                         return this;
                 },
                 showSuperfishUl : function(){
                         var o = sf.op,
                                 sh = sf.c.shadowClass+'-off',
                                 $ul = this.addClass(o.hoverClass)
                                         
 .find('ul:hidden').css('visibility','visible');
                         sf.IE7fix.call($ul);
                         o.onBeforeShow.call($ul);
                         $ul.animate(o.animationShow,o.speed,function(){ 
 sf.IE7fix.call
 ($ul); o.onShow.call($ul); });
                         //alert(show);
                         return this;
                 }
         });

 })(jQuery);

 this is out of the superfish.js.

 Can Please someone help me to get this working ?


[jQuery] setTimeout

2009-12-17 Thread decola
i have written a code that is working quiet fine.

setTimeout($(['li.',o.hoverClass].join(''),this).add(this).not
(not).removeClass(o.hoverClass).find('ul').css
('visibility','hidden'), 1000);


but it´s just don´t wait the 1 sec. What is wrong. Please help me.


Now the full code of the function but i think the line on top should
be enough


hideSuperfishUl : function(){
var o = sf.op,
not = (o.retainPath===true) ? o.$path : '';
o.retainPath = false;
var $ul = 
$(['li.',o.hoverClass].join(''),this).add(this).not
(not).find('ul');

sf.IE7fix.call($ul);
o.onBeforeHide.call($ul);
$ul.animate(o.animationHide,o.speed,function(){ 
sf.IE7fix.call
($ul); o.onHide.call($ul); });


setTimeout($(['li.',o.hoverClass].join(''),this).add(this).not
(not).removeClass(o.hoverClass).find('ul').css
('visibility','hidden'), o.speed);

return this;
}


[jQuery] Re: more ckeditor

2009-12-17 Thread Scott Sauyet
On Dec 17, 8:48 am, Mean Mike mcgra...@gmail.com wrote:
 I haven't played with the samples . CKEDITOR API is well documented is
 just the jquery implementation that I'm having trouble with

Yes, the documentation for the plug-in seems pretty vague.  But I
couldn't really find the syntax above in the CKEditor documentation
either; I had to go to the downloaded examples.  I knew that I could
call

something.on(eventName, func),

but I didn't know what I could call use for something or what values
were appropriate for eventName.

 it seems that you would be right but I do I know when  $
 (#fck).ckeditor() returns ?

It looks to me to be synchronous.  I haven't tested it, though.

 the problem seems to me that CKedtior.js isn't loaded until $
 (#fck).ckeditor() is called so if I call anyhting before that is
 finished I get CKEDITOR is undefined.

Perhaps just this, then:

$(#fck).ckeditor()
CKEDITOR.on( 'instanceReady', function(event) {
// your code here
});

It's worth a try in any case.

  -- Scott


[jQuery] Re: prompt before closing dialog

2009-12-17 Thread Obi1
OK, it's working fine. thank you for the indications.


Re: [jQuery] Jquery does not work in IE8

2009-12-17 Thread Karl Swedberg
If I view source on the detail frame, I see that you're referring to  
the $ function before you load the jQuery file. Put the script element  
that loads jQuery before your other script and see if that helps.


--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Dec 17, 2009, at 4:26 AM, blueshift wrote:


Jquery-1.3.2. runs fine in Safari and Firefox. In IE8 (using the
Developer Tools), I get the error: Could not get the position
property. Invalid argument jquery-1.3.2.js, line 12 character 12949.
Using debugging, the script highlights the characters {J[G]=K}.

I have no idea what this does, but it seems to cause the problem! The
result is when a thumbnail image is clicked in one of my galleries,
the image does not open in IE8. If anyone understands this or how to
correct it, I'd be very grateful!

See the problem in action (or not) on my website: www.blueshiftgallery.com
(click on a gallery to open the thumbnails).

Many thanks!




[jQuery] What is the canonical way of seeing if a selector returns an empty list?

2009-12-17 Thread Joe Grossberg
I understand that the way to see if there are any elements on the page
with the class of foo is this: $('.foo')

On a page with such elements, I will get a result like: jQuery(p.foo,
p.foo) and if there are no matching elements, I will get jQuery() --
or at least that's how it's displayed in Firebug.

Anyhow, an empty jQuery() is not false-y even when it is empty, and
this code (below) will always result in the first alert being called,
never the second:

if ( $('.foo') ) {
  alert('at least one matching element');
} else {
  alert('nothing matches');
}

Instead, I do it like this (since zero is false-y in JavaScript):

if ( $('.foo').length ) {
  alert('at least one matching element');
} else {
  alert('nothing matches');
}

But is that the preferred way of doing this?

Thanks,
Joe


[jQuery] Coloring fieldset or legend Red after error

2009-12-17 Thread Joey Toc
Hi there,

I have a form validated with the Validation JQuery. I want to turn the
fieldset or legend red after an error message comes up. I have this;

- Form -
---Fieldset ---
Legend(must be red after
error)
Radio button 1
Radio button 2
Radio button 3
 end of legend
--- end of fieldset ---


---Fieldset  2 ---
Legend 2(must be red after
error)
Radio button 1
Radio button 2
Radio button 3
 end of legend 2
--- end of fieldset 2 ---
- end of form -

I hope u understand my problem?
Is this possible with the validation jquery script?

Thanks!


[jQuery] make a dynamic div resizable

2009-12-17 Thread Alex
Hello there,
i'm trying get a div which is dynamically created resizable. the div
is created in an ajax request.
when i have the div on the page from the start there's no problem, it
works fine. only by putting it after the request in another div's body
it doesn't work. Here's some of my code.

if(isNaN(document.getElementById(frame_id)) == false) {
   var content_frame = div id=\+frame_id+\/div...;  //
There's much more ;-)

   var act_content = document.getElementById
('body_frame').innerHTML;
   var new_content = act_content+content_frame;
   document.getElementById('body_frame').innerHTML = new_content;
}

* Some more checks and validations *

$(.action_frame).draggable({ containment: '#body_frame', scroll:
false, handle: '.main_frame_title' });
$(#+frame_id).resizable();


Now it's created and here's where I want to make that little ... thing
resizable like this.
Weird is the object is draggable and it works great but the resizable
attribute doesn't aplly.

Any suggestions to this? Where's my issue?



[jQuery] Re: Styling dynamic content

2009-12-17 Thread Jason Kaczmarsky
I must have missed something cause I made a new page and rewrote the
code and it worked fine. Thanks for the help guys.

On Dec 17, 5:26 am, Richard D. Worth rdwo...@gmail.com wrote:
 Works for me:

 http://jsbin.com/egoto/

 - Richard

 On Wed, Dec 16, 2009 at 8:44 PM, Jason Kaczmarsky 
 jkaczmar...@yahoo.comwrote:

  Yes, I am sure they are the correct class and are showing up properly.

  Button press:
  //loop
  $(#files).append('div class=file'+Files[i]+'/div');
  //end loop

  Firebug:
  div id=files style=display: block;
  div class=filework.txt/div
  div class=fileSAS Guide.txt/div
  /div

  On Dec 16, 7:43 pm, Smith, Allex allex.sm...@chelanpud.org wrote:
   The browser should render all the styles no matter when they enter.

   Are you sure that the class is assigned to those elements? I would make
  sure by peeking at the rendered html via Firebug.

   -Original Message-
   From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
  Behalf Of Jason Kaczmarsky
   Sent: Wednesday, December 16, 2009 2:14 PM
   To: jQuery (English)
   Subject: [jQuery] Styling dynamic content

   So I've created a little app which loads some filenames into a div via
   an AJAX query. This happens when a user clicks a button, not when the
   page loads. Because of this, I cannot style the filenames how I want.
   I've tried using CSS to do the trick:

   .file{
   color: #F00;
   }

   .file:hover{
   cursor:pointer;
   color:#000;
   }

   This CSS colors the filenames red when it loads, but nothing in the
   hover event works.

   Instead of this, I tried using jQuery to style it.

   $(.file).hover(function(){
                   $(this).css(background-color,#F00);
           },function(){
                   $(this).css(background-color,#000);
           });

   This also does not change anything. I assume it is because the element
   does not exist when the page is rendered, but later on. Although this
   doesn't explain why the text is red when I use the CSS, so I'm a bit
   confused. How would I accomplish this?


Re: [jQuery] Coloring fieldset or legend Red after error

2009-12-17 Thread Leonardo K
Something like this:

$(.selector).validate({
highlight: function(element, errorClass) {
$(element).addClass(errorClass);
$(element.form).find(label[for= + element.id +
]).addClass(errorClass);
$(element).closest('fieldset').addClass(errorClass);
},
unhighlight: function(element, errorClass) {
$(element).removeClass(errorClass);
$(element.form).find(label[for= + element.id +
]).removeClass(errorClass);
$(element).closest('fieldset').removeClass(errorClass);
}
});


On Thu, Dec 17, 2009 at 11:40, Joey Toc tocj...@gmail.com wrote:

 Hi there,

 I have a form validated with the Validation JQuery. I want to turn the
 fieldset or legend red after an error message comes up. I have this;

 - Form -
 ---Fieldset ---
 Legend(must be red after
 error)
 Radio button 1
 Radio button 2
 Radio button 3
  end of legend
 --- end of fieldset ---


 ---Fieldset  2 ---
 Legend 2(must be red after
 error)
 Radio button 1
 Radio button 2
 Radio button 3
  end of legend 2
 --- end of fieldset 2 ---
 - end of form -

 I hope u understand my problem?
 Is this possible with the validation jquery script?

 Thanks!



Re: [jQuery] Coloring fieldset or legend Red after error

2009-12-17 Thread Leonardo K
then

.errorClass{
  background-color:red;
}

On Thu, Dec 17, 2009 at 14:27, Leonardo K leo...@gmail.com wrote:

 Something like this:

 $(.selector).validate({
 highlight: function(element, errorClass) {
 $(element).addClass(errorClass);
 $(element.form).find(label[for= + element.id +
 ]).addClass(errorClass);
 $(element).closest('fieldset').addClass(errorClass);
 },
 unhighlight: function(element, errorClass) {
 $(element).removeClass(errorClass);
 $(element.form).find(label[for= + element.id +
 ]).removeClass(errorClass);
 $(element).closest('fieldset').removeClass(errorClass);
 }
 });



 On Thu, Dec 17, 2009 at 11:40, Joey Toc tocj...@gmail.com wrote:

 Hi there,

 I have a form validated with the Validation JQuery. I want to turn the
 fieldset or legend red after an error message comes up. I have this;

 - Form -
 ---Fieldset ---
 Legend(must be red after
 error)
 Radio button 1
 Radio button 2
 Radio button 3
  end of legend
 --- end of fieldset ---


 ---Fieldset  2 ---
 Legend 2(must be red after
 error)
 Radio button 1
 Radio button 2
 Radio button 3
  end of legend 2
 --- end of fieldset 2 ---
 - end of form -

 I hope u understand my problem?
 Is this possible with the validation jquery script?

 Thanks!





Re: [jQuery] What is the canonical way of seeing if a selector returns an empty list?

2009-12-17 Thread Charlie Griefer
On Thu, Dec 17, 2009 at 7:32 AM, Joe Grossberg
joegrossberg@gmail.comwrote:

 Instead, I do it like this (since zero is false-y in JavaScript):

 if ( $('.foo').length ) {
  alert('at least one matching element');
 } else {
  alert('nothing matches');
 }

 But is that the preferred way of doing this?


As far as I am aware, yes... checking the length property is the way that
I've seen it done.

-- 
Charlie Griefer
http://charlie.griefer.com/

I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


Re: [jQuery] ajaxForm is not a function

2009-12-17 Thread neelay

hello,
i m getting same problem..

the way i m doing is
//--//
html
head
script src=jQuery/jquery-1.3.2.js type=text/javascript/script
script src=jquery.form.js type=text/javascript/script
script language=javascript

 $(document).ready(function() { 
// bind 'myForm' and provide a simple callback function 
$('#myForm').ajaxForm(function() { 
alert(Thank you for your comment!); 
}); 
}); 

// wait for the DOM to be loaded 
   
/script

/head
body

form id=myForm action=comment.php method=post 
   label for=fileFilename:/label
input type=file name=file id=file /
br /
input type=submit value=Upload Pic / 
/form

/body
/html 
////


biggimot wrote:
 
 Hi all
 
 I am trying to bind the JQuery form plugin in zend framework.
 I get an error with the sample :confused:
 
 script type=text/javascript
 // wait for the DOM to be loaded 
 $(document).ready(function() { 
 // bind 'myForm' and provide a simple callback function 
 $('#myForm').ajaxForm(function() { 
 alert(Thank you for your comment!); 
 });
   
   return false; 
 }); 
 /script 
 
 and form
 
 form id=myForm name=myForm method=post 
 Name: input type=text name=name / 
 Comment: textarea name=comment/textarea 
 input type=submit value=Submit Comment / 
 /form
 
 the submit button work but the alert window don't show
 
 in firebug i get this error $(#myForm).ajaxForm is not a function
 
 Thanks
 Serge
 
 

-- 
View this message in context: 
http://old.nabble.com/ajaxForm-is-not-a-function-tp17761901s27240p26831146.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



Re: [jQuery] setTimeout

2009-12-17 Thread Michael Geary
You are calling the lengthy jQuery chain *first* and then passing its result
to setTimeout. Your code is equivalent to:

var temp =
$(['li.',o.hoverClass].join(''),this)
.add(this)
.not(not)
.removeClass(o.hoverClass)
.find('ul')
.css('visibility','hidden');

setTimeout( temp, 1000 );

Instead, you need to pass a *function* to setTimeout:

setTimeout( function() {
$(['li.',o.hoverClass].join(''),this)
.add(this)
.not(not)
.removeClass(o.hoverClass)
.find('ul')
.css('visibility','hidden');
}, 1000 );

-Mike

On Thu, Dec 17, 2009 at 6:47 AM, decola decola...@googlemail.com wrote:

 setTimeout($(['li.',o.hoverClass].join(''),this).add(this).not
 (not).removeClass(o.hoverClass).find('ul').css
 ('visibility','hidden'), 1000);



Re: [jQuery] Re: How to compare data in 2 jQuery data() elements

2009-12-17 Thread Michael Geary
I think you guys are making this too complicated. Just loop through the data
properties:

function dataChanged( a, b ) {
for( var key in a )
if( a[key] != b[key] ) return true;
return false;
}

if( dataChanged(o,n) ) {
someAJAXFunctionThatSavesTheFieldsThatChanged();
}

-Mike

On Thu, Dec 17, 2009 at 5:58 AM, discern cap...@gmail.com wrote:

 Thanks. I'll give that a go. Otherwise, I'll just write 2 different
 functions: one for comparison (I'll probably compare hashes using the
 sha1 plugin) and one for sending the data to the backend.



[jQuery] Re: Jquery does not work in IE8

2009-12-17 Thread blueshift
Dear Karl,

Thank you for your reply. I tried moving the jquery scripts before
everything else, but it seems to have no effect in IE.
I moved it back, and this is what it looks like now. (This all works
fine in Safari 4.0.4). Do you have any other suggestions?! Sorry, but
as you can tell, I find this stuff very hard to understand! Jurgen :-)

htmlhead
titleDreams Gallery/title
base target=detail
script language=JavaScript


// Checks the browser and adds classes to the body to reflect it.

$(document).ready(function(){

var userAgent = navigator.userAgent.toLowerCase();
$.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase
());

// Is this a version of IE?
if($.browser.msie){
$('body').addClass('browserIE');

// Add the version number
$('body').addClass('browserIE' + $.browser.version.substring
(0,1));
}


// Is this a version of Chrome?
if($.browser.chrome){

$('body').addClass('browserChrome');

//Add the version number
userAgent = userAgent.substring(userAgent.indexOf('chrome/')
+7);
userAgent = userAgent.substring(0,1);
$('body').addClass('browserChrome' + userAgent);

// If it is chrome then jQuery thinks it's safari so we have
to tell it it isn't
$.browser.safari = false;
}

// Is this a version of Safari?
if($.browser.safari){
$('body').addClass('browserSafari');

// Add the version number
userAgent = userAgent.substring(userAgent.indexOf('version/')
+8);
userAgent = userAgent.substring(0,1);
$('body').addClass('browserSafari' + userAgent);
}

// Is this a version of Mozilla?
if($.browser.mozilla){

//Is it Firefox?
if(navigator.userAgent.toLowerCase().indexOf('firefox') != -1)
{
$('body').addClass('browserFirefox');

// Add the version number
userAgent = userAgent.substring(userAgent.indexOf
('firefox/') +8);
userAgent = userAgent.substring(0,1);
$('body').addClass('browserFirefox' + userAgent);
}
// If not then it must be another Mozilla
else{
$('body').addClass('browserMozilla');
}
}

// Is this a version of Opera?
if($.browser.opera){
$('body').addClass('browserOpera');
}


});

!--
function na_preload_img()
{
  var img_list = na_preload_img.arguments;
  if (document.preloadlist == null)
document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i  img_list.length; i++) {
document.preloadlist[top+i] = new Image;
document.preloadlist[top+i].src = img_list[i+1];
  }
}

function na_change_img_src(name, nsdoc, rpath, preload)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ?
nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
return;
  if (img) {
img.altsrc = img.src;
img.src= rpath;
  }
}

function na_restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ?
nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
return;
  if (img  img.altsrc) {
img.src= img.altsrc;
img.altsrc = null;
  }
}

// --
/script
meta http-equiv=Content-Type content=text/html;
charset=ISO-8859-1style type=text/css
!--
body {
background-color: #00;
}
--
/style/head

titlejCarousel/title

link rel=stylesheet type=text/css href=Scripts/style.css /
script type=text/javascript src=Scripts/js/jquery-1.3.2.min.js/
script
script type=text/javascript src=Scripts/js/
jcarousellite_1.0.1.pack.js/script
script type=text/javascript src=Scripts/js/captify.tiny.js/
script
script type=text/javascript
//jCarouselLite
$(function() {
$(.slider).jCarouselLite({
btnNext: .next,
btnPrev: .prev,
visible: 8
});
});

//Captify
$(document).ready(function(){
$('img.captify').captify({
// all of these options are... optional
// speed of the mouseover effect
speedOver: 'fast',
// speed of the mouseout effect
speedOut: 'normal',
// how long to delay the hiding of the caption after mouseout (ms)
hideDelay: 500,
// 'fade', 'slide', 'always-on'
animation: 'slide',
// text/html to be placed at the beginning of every caption
prefix: '',
// opacity of the caption on mouse over
opacity: '0.7',
// the name of the CSS class to apply to the caption box
className: 'caption-bottom',
// position of the caption (top or bottom)
position: 'bottom',
// caption span % of the image
spanWidth: '100%'
});
});
/script

/head

body

div id=list
div class=previmg src=Scripts/images/prev.jpg alt=prev //
div

  div class=slider
ul



lia href=Gallery%20Dreams/Perchance%20Desc.htm title=Perchance
to Dream target=detailimg src=Gallery Dreams/Perchance to Dream
Thumb.jpg alt=Perchance to Dream class=captify //a/li

lia 

[jQuery] Re: more ckeditor

2009-12-17 Thread Mean Mike

 Perhaps just this, then:

     $(#fck).ckeditor()
     CKEDITOR.on( 'instanceReady', function(event) {
         // your code here
     });

 It's worth a try in any case.

so I tried that and of course I get CKEDITOR not defined ...
so I figure ot I'll wait for I try it this way
$('#fck').ckeditor();
var wait = setTimeout(function() {
if( $.ckeditor.instance(fck)) {
var editor = $.ckeditor.instance(fck);
editor.document.on(keyup,function(e){
alert(keyup);
});
clearTimeout(wait);
}
}, 2000);
and this works because it waits for the editor to load but it seems to
me there should be a better way


[jQuery] Re: Jquery does not work in IE8

2009-12-17 Thread MorningZ
Your HTML is totally screwed

you've got multiple closing /head tags... you aren't including the
jQuery file before you try to do jQuery stuff first as Karl
suggests and don't confuse works in safari as jQuery must be
horked in IE, that's totally not the case... one browser handles poor
HTML differently/better/worse than another


[jQuery] Re: Coloring fieldset or legend Red after error

2009-12-17 Thread Joey Toc
Thanks for your quick reply! But i cant get it working.
Im a JQuery noob i think, hehe.

This is the configuration for the Validate function:
-
$().ready(function() {
$(#registratie).validate({
highlight: function(element, errorClass) {
$(element).addClass(errorClass);
$(element.form).find(label[for= + element.id 
+]).addClass
(errorClass);

$(element).closest('legend').addClass(errorClass);
},
unhighlight: function(element, errorClass) {
$(element).removeClass(errorClass);
$(element.form).find(label[for= + element.id 
+]).removeClass
(errorClass);

$(element).closest('legend').removeClass(errorClass);
},
rules: {
naam: required,
achternaam: required,
adres: required,
postcode: required,
plaats: required,
telefoonnummer: required,
email: {
required: true,
email: true
},
pakket: {required :true},
}
});
});
-
And here's a short piece of the form
-
  fieldset
  legendPakket informatie/legend
  table width=600 border=0 class=tabel
tr
  td colspan=2labelinput name=pakket type=radio
value= /strongFotoBox Small/strong/label - Meer informatie
over dit pakket/td
/tr
tr
  td colspan=2labelinput name=pakket type=radio
value= /strongFotoBox Medium/strong/label - Meer informatie
over dit pakket/td
/tr
tr
  td colspan=2labelinput name=pakket type=radio
value= /strongFotoBox Large/strong/label - Meer informatie
over dit pakket/td
/tr
/table
/fieldset
-
Is there anything i am not awear of?
Plz, help me!

Thanks


[jQuery] [multifile] Programmatic functionality not working

2009-12-17 Thread Rus Miller
Getting the MultiFile plugin (jQuery Multiple File Upload Plugin
v1.46) working programmatically is not happening for me.

Please see two demos with a class-based and programmatic approach
(view source and check the js files)...the link to switch between them
is at the top: http://monovisiondesign.com/sandbox/multifile/

It works when I apply the plugin through class selectors:

input class=text multi accept-pdf max-5 type=file name=pdf_url
[] id=pdf_url /

But I would like more control over the functionality.  For instance, I
have a select list that determines the number of files that can be
uploaded per a particular selected index and I'd also like to display
a 'remove' image for each selected file, which doesn't appear possible
with the class-based approach.  However, when I attempt to run this,
each MultiFile input allows only one file to be selected before
disabling itself.

Any clues as to what I'm doing wrong?

jQuery('#type').change(function(){
  var text = jQuery('#type :selected').text();
  enableMultiFile(text);
}

function enableMultiFile(text){
jQuery('input:file').MultiFile('reset');
jQuery('#img_url').MultiFile({accept: 'gif|jpg|png', STRING: {
remove: 'img 
src=http://www.fyneworks.com/@/bin.gif; height=16
width=16 alt=x/'
}});
jQuery('#logo_url').MultiFile({max: 1, accept: 'gif|jpg|png',
STRING: {
remove: 'img 
src=http://www.fyneworks.com/@/bin.gif; height=16
width=16 alt=x/'
}});
if(text == 'press-releases') {
jQuery('#pdf_url').MultiFile({max: 1, accept: 'pdf', 
STRING: {
remove: 'img 
src=http://www.fyneworks.com/@/bin.gif; height=16
width=16 alt=x/'
}});
}else{
jQuery('#pdf_url').MultiFile({max: 5, accept: 'pdf', 
STRING: {
remove: 'img 
src=http://www.fyneworks.com/@/bin.gif; height=16
width=16 alt=x/'
}});
}
}


[jQuery] Re: Coloring fieldset or legend Red after error

2009-12-17 Thread Joey Toc
Hey, Thanks man, after some frustrating hours i finaly got it working.
Thanks for your code tip!

Grtz


[jQuery] Re: Jquery does not work in IE8

2009-12-17 Thread MorningZ
here is what i was talking about:

- no jQuery first before you are doing the $.browser stuff
- duplicate title tags, although that shouldn't do anything but
confuse the browser, no break it
- rouge /head tag, that would DEFINITELY be an issue, especially for
IE

html

head

titleDreams Gallery/title
base target=detail

script language=JavaScript
   //jQuery in here
/script

meta http-equiv=Content-Type content=text/html

style type=text/css
/style

/head

titlejCarousel/title
link rel=stylesheet type=text/css href=style.css /
script src=jquery-1.3.2.min.js/script
script src=jcarousellite_1.0.1.pack.js/script
script src=captify.tiny.js/script
script type=text/javascript
 //jQuery code
/script

/head

body
   the html
/body

/html


[jQuery] What is the event when a user presses the enter key anywhere on the page?

2009-12-17 Thread laredotorn...@zipmail.com
Hi,

I would like to capture the event of pressing enter anywhere on the
page, even if the focus of the mouse cursor is not on a text field.
What event/element am I looking at?

Thanks, - Dave


[jQuery] Re: What is the event when a user presses the enter key anywhere on the page?

2009-12-17 Thread Mean Mike
keypress

$(document).keypress(function(e) {
if ((e.which  e.which == 13) || 
(e.keyCode e.keyCode == 13))
{
// do something
}
});
mean mike
On Dec 17, 2:03 pm, laredotorn...@zipmail.com
laredotorn...@zipmail.com wrote:
 Hi,

 I would like to capture the event of pressing enter anywhere on the
 page, even if the focus of the mouse cursor is not on a text field.
 What event/element am I looking at?

 Thanks, - Dave


[jQuery] Changing colspan with jQuery

2009-12-17 Thread davec
I am trying to change the colspan attribute on some table cells when
the user clicks on a button but it is not affecting the table. Perhaps
someone can tell me what I am doing wrong. Here is my jQuery code:

script type=text/javascript
$(document).ready(function() {
   $('#plusSign').click(function(){
  $('.ba_toggle').toggle();
if(document.getElementById('plusSign').innerHTML=='+')
{
   document.getElementById('plusSign').innerHTML='-';
   $('th.ba_colspan, td.ba_colspan').each(function(){
$(this).attr('bgColor','red');
   });
}
else
{
document.getElementById('plusSign').innerHTML='+';
$('th.ba_colspan, td.ba_colspan').each(function(){
$(this).attr('bgColor','green');
});
}
 });
  });
/script


[jQuery] Changing colspan with jQuery

2009-12-17 Thread davec
I am trying to change the colspan attribute on some table cells when
the user clicks on a button but it is not affecting the table. Perhaps
someone can tell me what I am doing wrong. Here is my jQuery code:

script type=text/javascript
$(document).ready(function() {
   $('#plusSign').click(function(){
  $('.ba_toggle').toggle();
if(document.getElementById('plusSign').innerHTML=='+')
{
   document.getElementById('plusSign').innerHTML='-';
   $('th.ba_colspan, td.ba_colspan').each(function(){
$(this).attr('bgColor','red');
   });
}
else
{
document.getElementById('plusSign').innerHTML='+';
$('th.ba_colspan, td.ba_colspan').each(function(){
$(this).attr('bgColor','green');
});
}
 });
  });
/script


Re: [jQuery] Changing colspan with jQuery

2009-12-17 Thread Charlie Griefer
I see where you're changing background colors, but where are you trying to
change colspans?

untested, but

 $('myTDelement').attr('colspan', x);

... where 'x' is the numeric value, should work.

also, it's criminal to use document.getElementById() within jQuery.
$('#element') is so much more elegant :)

script type=text/javascript
$(document).ready(function() {
$('#plusSign').click(function() {
$('.ba_toggle').toggle();

   if $('#plusSign').html() == +) {
   $('#plusSign').html('-');
$('th.ba_colspan, td.ba_colspan').each(function() {
$(this).attr('bgColor','red');
});
   } else {
   $('#plusSign').html('+');
$('th.ba_colspan, td.ba_colspan').each(function() {
$(this).attr('bgColor','green');
});
   }

   });
});
/script


On Thu, Dec 17, 2009 at 11:23 AM, davec dcah...@hyphensolutions.com wrote:

 I am trying to change the colspan attribute on some table cells when
 the user clicks on a button but it is not affecting the table. Perhaps
 someone can tell me what I am doing wrong. Here is my jQuery code:

 script type=text/javascript
 $(document).ready(function() {
   $('#plusSign').click(function(){
  $('.ba_toggle').toggle();
if(document.getElementById('plusSign').innerHTML=='+')
{
   document.getElementById('plusSign').innerHTML='-';
   $('th.ba_colspan, td.ba_colspan').each(function(){
$(this).attr('bgColor','red');
   });
}
else
{
document.getElementById('plusSign').innerHTML='+';
$('th.ba_colspan, td.ba_colspan').each(function(){
$(this).attr('bgColor','green');
});
}
 });
  });
 /script




-- 
Charlie Griefer
http://charlie.griefer.com/

I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] Re: What is the event when a user presses the enter key anywhere on the page?

2009-12-17 Thread Mean Mike
awesome Mike, thank you

Mike

On Dec 17, 2:50 pm, Michael Geary m...@mg.to wrote:
 Good tip, thanks, Mike.

 A couple of suggestions... First, you could simplify that if test to:

   if( e.which == 13  ||  e.keyCode == 13 )

 That would do exactly the same thing in all cases as the original code.

 But you can simplify it even more. jQuery cleans up the properties of the
 event object so you don't have to make the browser-dependent tests for both
 'which' and 'keyCode'. You can just use 'which' in all browsers:

     if( e.which == 13 )

 -Mike

 On Thu, Dec 17, 2009 at 11:06 AM, Mean Mike mcgra...@gmail.com wrote:
  keypress

                                 $(document).keypress(function(e) {
                                         if ((e.which  e.which == 13) ||
  (e.keyCode e.keyCode == 13))
  {
                                         // do something
                                         }
                                 });
  mean mike
  On Dec 17, 2:03 pm, laredotorn...@zipmail.com
  laredotorn...@zipmail.com wrote:
   Hi,

   I would like to capture the event of pressing enter anywhere on the
   page, even if the focus of the mouse cursor is not on a text field.
   What event/element am I looking at?

   Thanks, - Dave


[jQuery] jQuery FullCalendar Fetch Events Optimization

2009-12-17 Thread WhoButSB
Hello All,

I was wondering if someone could give me some pointers to help
optimize my jQuery Full Calendar Code.  The issue i'm running into is
when I fetch a lot of events through AJAX ( 25), the browser stalls
and becomes unresponsive usually resulting in a message to the user to
abort the script.  I'm trying to avoid this error, and I was wondering
if there was something I could do in my function to improve the
loading time.

Here is a copy of the function I'm running:

//Load the Business Unit Calendar Events
function ajaxBUEvents(start, end){
//Loop through the selected checked calendars
$(selectBUCalendars()).each(function(i, cal){
$.ajax({
type: 'POST',
data: {'startDate': start, 'endDate': end, 'buCals[]': 
cal},
url: '?= 
site_url('AJAX/calendar_ajax/get_cal_events'); ?',
dataType: 'json',
async: false,
beforeSend: function(){
$('#loading-dialog').dialog({minHeight: 100, 
width: 250}).dialog
('open');
$('#loading-dialog p').text('Loading '+cal+' 
Calendar Events');
},
success: function(calevents){
$.each(calevents, function(i, calevent){

$('#calendar').fullCalendar('renderEvent', calevent, true);
});
}
});
});
$('#loading-dialog').dialog('close');
}

And here is a sample of the JSON that is returned, this is only one
event. Sometimes there can be 50+ events returned:
[{id:4377,title:BWR - Lighting Affiliates Dinner -
Actualized,start:1259874000,end:1259888400,className:BWR
Actualized,allDay:false,editable:false}]

Thank you for the help!


[jQuery] Re: more ckeditor

2009-12-17 Thread Scott Sauyet
On Dec 17, 1:02 pm, Mean Mike mcgra...@gmail.com wrote:

 so I tried that and of course I get CKEDITOR not defined ...

Bummer!

 so I figure ot I'll wait for I try it this way
         $('#fck').ckeditor();
         var wait = setTimeout(function() {
                 if( $.ckeditor.instance(fck)) {
                         var editor = $.ckeditor.instance(fck);
                         editor.document.on(keyup,function(e){
                                 alert(keyup);
                         });
                         clearTimeout(wait);
                         }
         }, 2000);
 and this works because it waits for the editor to load but it seems to
 me there should be a better way

There certainly should be.  It makes me wonder if the plug-in really
has any value.  If all it's doing is to use jQuery's selector engine
to identify the elements you want to use for CKEditor, it hardly seems
worth it, especially when you're likely to just be selecting by id.

One thing you could do is write a simple waitFor script that
continually polls and calls your function as soon as it's ready,
something you could use like this:

waitFor(
function() {return $.ckeditor.instance(fck);},
function() {
$.ckeditor.instance(fck).document.on(keyup,function(e)
{
alert(keyup);
});
},
1 // timeout in 10 seconds
}

A simple version of waitFor (that doesn't do any error checking) might
look like this:

function waitFor(testFn, mainFn, timeout) {
var start = new Date().getTime();
setTimeout(function again() {
if (testFn()) {
mainFn();
} else if (!timeout || new Date().getTime()  start +
timeout) {
setTimeout(again, 10);
} else {
// wait timed out.
}
}, 10);
}

At least here, you don't have to wait an arbitrary two seconds, but
are ready to go almost as soon as your data is back.

Good luck,

  -- Scott


[jQuery] Re: setTimeout

2009-12-17 Thread decola
thx for the quick answer, but this way i´ve tried it too. I have
copied your code and test it too but it just don´t work.

The function is called an a alert for example makes it output but the
important code is not running like this.

On 17 Dez., 18:21, Michael Geary m...@mg.to wrote:
 You are calling the lengthy jQuery chain *first* and then passing its result
 to setTimeout. Your code is equivalent to:

 var temp =
     $(['li.',o.hoverClass].join(''),this)
         .add(this)
         .not(not)
         .removeClass(o.hoverClass)
         .find('ul')
         .css('visibility','hidden');

 setTimeout( temp, 1000 );

 Instead, you need to pass a *function* to setTimeout:

 setTimeout( function() {
     $(['li.',o.hoverClass].join(''),this)
         .add(this)
         .not(not)
         .removeClass(o.hoverClass)
         .find('ul')
         .css('visibility','hidden');

 }, 1000 );

 -Mike

 On Thu, Dec 17, 2009 at 6:47 AM, decola decola...@googlemail.com wrote:
  setTimeout($(['li.',o.hoverClass].join(''),this).add(this).not
  (not).removeClass(o.hoverClass).find('ul').css
  ('visibility','hidden'), 1000);


Re: [jQuery] Re: setTimeout

2009-12-17 Thread Michael Geary
I'm sorry, I should have spotted the major bug in the code that I posted.

In fact, it's particularly embarrassing, because I wrote a recipe for the
jQuery Cookbook [1] on this exact topic. It's recipe 5.2, What's Wrong with
$(this)?

Inside the setTimeout callback function, this does not have the same value
that it has outside the function.

To fix it, copy your this value into another variable before calling
setTimeout:

var element = this;
setTimeout( function() {
$(['li.',o.hoverClass].join(''),element)
.add(element)
.not(not)
.removeClass(o.hoverClass)
.find('ul')
.css('visibility','hidden');
}, 1000 );

Because 'element' is an ordinary JavaScript variable, it is available to the
inner nested function (the setTimeout callback).

BTW, here's a suggestion for another way to code the jQuery chain. It's six
of one, half a dozen of the other, but to my eyes this is a tiny bit easier
to follow:

var element = this;
setTimeout( function() {
$(element)
.find( 'li.' + o.hoverClass )
 .andSelf()
.not(not)
.removeClass(o.hoverClass)
.find('ul')
.css('visibility','hidden');
}, 1000 );


-Mike

[1]: http://www.amazon.com/dp/0596159773/

On Thu, Dec 17, 2009 at 1:02 PM, decola decola...@googlemail.com wrote:

 thx for the quick answer, but this way i´ve tried it too. I have
 copied your code and test it too but it just don´t work.

 The function is called an a alert for example makes it output but the
 important code is not running like this.

 On 17 Dez., 18:21, Michael Geary m...@mg.to wrote:
  You are calling the lengthy jQuery chain *first* and then passing its
 result
  to setTimeout. Your code is equivalent to:
 
  var temp =
  $(['li.',o.hoverClass].join(''),this)
  .add(this)
  .not(not)
  .removeClass(o.hoverClass)
  .find('ul')
  .css('visibility','hidden');
 
  setTimeout( temp, 1000 );
 
  Instead, you need to pass a *function* to setTimeout:
 
  setTimeout( function() {
  $(['li.',o.hoverClass].join(''),this)
  .add(this)
  .not(not)
  .removeClass(o.hoverClass)
  .find('ul')
  .css('visibility','hidden');
 
  }, 1000 );
 
  -Mike
 
  On Thu, Dec 17, 2009 at 6:47 AM, decola decola...@googlemail.com
 wrote:
   setTimeout($(['li.',o.hoverClass].join(''),this).add(this).not
   (not).removeClass(o.hoverClass).find('ul').css
   ('visibility','hidden'), 1000);



Re: [jQuery] Re: setTimeout

2009-12-17 Thread Michael Geary
p.s. If there are extra blank lines in my code samples, those aren't
intentional (especially not that one in the middle of the chain). Gmail is
adding those for some reason!

On Thu, Dec 17, 2009 at 1:19 PM, Michael Geary m...@mg.to wrote:

 I'm sorry, I should have spotted the major bug in the code that I posted.

 In fact, it's particularly embarrassing, because I wrote a recipe for the
 jQuery Cookbook [1] on this exact topic. It's recipe 5.2, What's Wrong with
 $(this)?

 Inside the setTimeout callback function, this does not have the same
 value that it has outside the function.

 To fix it, copy your this value into another variable before calling
 setTimeout:

 var element = this;
 setTimeout( function() {
 $(['li.',o.hoverClass].join(''),element)
 .add(element)

 .not(not)
 .removeClass(o.hoverClass)
 .find('ul')
 .css('visibility','hidden');
 }, 1000 );

 Because 'element' is an ordinary JavaScript variable, it is available to
 the inner nested function (the setTimeout callback).

 BTW, here's a suggestion for another way to code the jQuery chain. It's six
 of one, half a dozen of the other, but to my eyes this is a tiny bit easier
 to follow:

 var element = this;
 setTimeout( function() {
 $(element)
 .find( 'li.' + o.hoverClass )
  .andSelf()

 .not(not)
 .removeClass(o.hoverClass)
 .find('ul')
 .css('visibility','hidden');
 }, 1000 );


 -Mike

 [1]: http://www.amazon.com/dp/0596159773/


 On Thu, Dec 17, 2009 at 1:02 PM, decola decola...@googlemail.com wrote:

 thx for the quick answer, but this way i´ve tried it too. I have
 copied your code and test it too but it just don´t work.

 The function is called an a alert for example makes it output but the
 important code is not running like this.

 On 17 Dez., 18:21, Michael Geary m...@mg.to wrote:
  You are calling the lengthy jQuery chain *first* and then passing its
 result
  to setTimeout. Your code is equivalent to:
 
  var temp =
  $(['li.',o.hoverClass].join(''),this)
  .add(this)
  .not(not)
  .removeClass(o.hoverClass)
  .find('ul')
  .css('visibility','hidden');
 
  setTimeout( temp, 1000 );
 
  Instead, you need to pass a *function* to setTimeout:
 
  setTimeout( function() {
  $(['li.',o.hoverClass].join(''),this)
  .add(this)
  .not(not)
  .removeClass(o.hoverClass)
  .find('ul')
  .css('visibility','hidden');
 
  }, 1000 );
 
  -Mike
 
  On Thu, Dec 17, 2009 at 6:47 AM, decola decola...@googlemail.com
 wrote:
   setTimeout($(['li.',o.hoverClass].join(''),this).add(this).not
   (not).removeClass(o.hoverClass).find('ul').css
   ('visibility','hidden'), 1000);





[jQuery] Re: setTimeout

2009-12-17 Thread decola
I will reformate the code myself but thx. And a really big thx for
helping me it´s working. You saved my day ... really.


thx :)

On 17 Dez., 22:21, Michael Geary m...@mg.to wrote:
 p.s. If there are extra blank lines in my code samples, those aren't
 intentional (especially not that one in the middle of the chain). Gmail is
 adding those for some reason!

 On Thu, Dec 17, 2009 at 1:19 PM, Michael Geary m...@mg.to wrote:
  I'm sorry, I should have spotted the major bug in the code that I posted.

  In fact, it's particularly embarrassing, because I wrote a recipe for the
  jQuery Cookbook [1] on this exact topic. It's recipe 5.2, What's Wrong with
  $(this)?

  Inside the setTimeout callback function, this does not have the same
  value that it has outside the function.

  To fix it, copy your this value into another variable before calling
  setTimeout:

  var element = this;
  setTimeout( function() {
      $(['li.',o.hoverClass].join(''),element)
          .add(element)

          .not(not)
          .removeClass(o.hoverClass)
          .find('ul')
          .css('visibility','hidden');
  }, 1000 );

  Because 'element' is an ordinary JavaScript variable, it is available to
  the inner nested function (the setTimeout callback).

  BTW, here's a suggestion for another way to code the jQuery chain. It's six
  of one, half a dozen of the other, but to my eyes this is a tiny bit easier
  to follow:

  var element = this;
  setTimeout( function() {
      $(element)
          .find( 'li.' + o.hoverClass )
           .andSelf()

          .not(not)
          .removeClass(o.hoverClass)
          .find('ul')
          .css('visibility','hidden');
  }, 1000 );

  -Mike

  [1]:http://www.amazon.com/dp/0596159773/

  On Thu, Dec 17, 2009 at 1:02 PM, decola decola...@googlemail.com wrote:

  thx for the quick answer, but this way i´ve tried it too. I have
  copied your code and test it too but it just don´t work.

  The function is called an a alert for example makes it output but the
  important code is not running like this.

  On 17 Dez., 18:21, Michael Geary m...@mg.to wrote:
   You are calling the lengthy jQuery chain *first* and then passing its
  result
   to setTimeout. Your code is equivalent to:

   var temp =
       $(['li.',o.hoverClass].join(''),this)
           .add(this)
           .not(not)
           .removeClass(o.hoverClass)
           .find('ul')
           .css('visibility','hidden');

   setTimeout( temp, 1000 );

   Instead, you need to pass a *function* to setTimeout:

   setTimeout( function() {
       $(['li.',o.hoverClass].join(''),this)
           .add(this)
           .not(not)
           .removeClass(o.hoverClass)
           .find('ul')
           .css('visibility','hidden');

   }, 1000 );

   -Mike

   On Thu, Dec 17, 2009 at 6:47 AM, decola decola...@googlemail.com
  wrote:
setTimeout($(['li.',o.hoverClass].join(''),this).add(this).not
(not).removeClass(o.hoverClass).find('ul').css
('visibility','hidden'), 1000);


[jQuery] Re: setTimeout

2009-12-17 Thread Marco Barbosa
Hi!

Sorry to hop in this topic but it's always easier than creating a new
one :)

My problem is that I have a dropdown list, but the child list (li 
ul) is not exactly below the parent.
So when I leave the parent to hover the child, it disappears before I
have the chance.
This is not something I can change since this menu requires
position:absolute (at least for now)

So I though I could use setTimeout ?
before hiding setTimeout so the user has the chance to go to the
dropdown menu

This is my script:
$(#community).mouseover( function() {

$(this).children(ul).css(display,block).animate({opacity:
1.0}, 2000);
}).mouseout( function() {

$(this).children(ul).animate({opacity: 1.0}, 2000).css
(display,none);
});

Note that I was trying to use animate to achieve this. Stay there 2
seconds after showing up and before hiding it.

I already tried setTimeout with no success either:

$(#community).mouseover( function() {

$(this).children(ul).css(display,block);
}).mouseout( function() {
$(this).children(ul).setTimeout( 
function() {
 
$(this).children(ul).css(display,none);

},
1000 );css(display,none);
});

Could you point me in the right direction Michael ?

Do you think setTimeout could work?


[jQuery] jquery.color.js no longer maintained?

2009-12-17 Thread John Arrowwood
All,

I got bit by a number of bugs in the Color Animations plugin.  So, I fixed
them and uploaded the fix to the comments on the issue I submitted against
it.

Then I noticed, other people have submitted patches as far back as almost 2
years ago.  So it looks like this module is no longer being actively
maintained.

If that is the case, how do we go about getting a new release out there?

More importantly, when will this functionality be added to the core?  :)

-- 
John Arrowwood
John (at) Irie (dash) Inc (dot) com
John (at) Arrowwood Photography (dot) com
John (at) Hanlons Razor (dot) com
--
http://arrowwood.blogspot.com
Pablo Picassohttp://www.brainyquote.com/quotes/authors/p/pablo_picasso.html
- Computers are useless. They can only give you answers.


Re: [jQuery] jQuery FullCalendar Fetch Events Optimization

2009-12-17 Thread Michael Geary
50 events should be like nothing.

I suspect the problem may be that you're calling
$('#calendar').fullCalendar('renderEvent', calevent, true); separately for
each individual event.

I'm not too familiar with the Full Calendar, but can you use the 'events'
option described on this page:

http://arshaw.com/fullcalendar/docs/events-and-sources.php

That sounds like it should let you feed your entire events array into Full
Calendar in one fell swoop.

Also, the async:false option in your $.ajax call is a VERY BAD IDEA. Sorry
for the shouting! But in a single-threaded browser like Firefox, that option
will not only lock up the current browser tab during the download, but it
will also lock up all browser tabs in all windows. If your site is slow to
respond and your visitor decides to go look at another browser window while
it loads, they will find that all their browser windows are locked up
completely. Not a good thing. Do you need the async:false?

-Mike

On Thu, Dec 17, 2009 at 12:27 PM, WhoButSB whobu...@gmail.com wrote:

 Hello All,

 I was wondering if someone could give me some pointers to help
 optimize my jQuery Full Calendar Code.  The issue i'm running into is
 when I fetch a lot of events through AJAX ( 25), the browser stalls
 and becomes unresponsive usually resulting in a message to the user to
 abort the script.  I'm trying to avoid this error, and I was wondering
 if there was something I could do in my function to improve the
 loading time.

 Here is a copy of the function I'm running:

 //Load the Business Unit Calendar Events
 function ajaxBUEvents(start, end){
//Loop through the selected checked calendars
$(selectBUCalendars()).each(function(i, cal){
$.ajax({
type: 'POST',
data: {'startDate': start, 'endDate': end,
 'buCals[]': cal},
url: '?=
 site_url('AJAX/calendar_ajax/get_cal_events'); ?',
dataType: 'json',
async: false,
beforeSend: function(){
$('#loading-dialog').dialog({minHeight: 100,
 width: 250}).dialog
 ('open');
$('#loading-dialog p').text('Loading '+cal+'
 Calendar Events');
},
success: function(calevents){
$.each(calevents, function(i, calevent){

  $('#calendar').fullCalendar('renderEvent', calevent, true);
});
}
});
});
$('#loading-dialog').dialog('close');
 }

 And here is a sample of the JSON that is returned, this is only one
 event. Sometimes there can be 50+ events returned:
 [{id:4377,title:BWR - Lighting Affiliates Dinner -
 Actualized,start:1259874000,end:1259888400,className:BWR
 Actualized,allDay:false,editable:false}]

 Thank you for the help!



[jQuery] Re: validate - error messages keep piling up

2009-12-17 Thread Mark Livingstone
OK, thanks. I will try and report back.

On Dec 16, 12:22 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 You have three classes specified for the errorClass. The plugin can't handle
 that. If you actually need more then one class, use the highlight and
 unhighlight options to add and remove those.

 Jörn

 On Wed, Dec 16, 2009 at 4:43 PM, Mark Livingstone 
 namematters...@msn.comwrote:

  On Dec 16, 9:59 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
  wrote:

   At least post your full JS codes instead of just excerpts.

   Jörn

 http://jsbin.com/isuco/edit

  I can e-mail you the link to my working page if that will help.
  Unfortunately I cannot share it here.


[jQuery] Re: Changing colspan with jQuery

2009-12-17 Thread davec
Sorry, I posted the wrong codemy code looked exactly like what
you said but it did change the rendering of the table after I set the
new value. Basically, what I have been trying to do was the following:
- First I render the table and have a column heading cell that spans 4
columns
- Then I click on the button which hides two of the columns
- I want the table cell in the header row that originally spaned 4
columns to now only span 2 columns but I could not get it to work
correctly. I did add some alert tags to redisplay the colspan
attribute and it said it was changed from 4 to 2 but the header cell
still spanned 4 columns.

I cheated and did it a way I do not like. In essence I built duplicate
table header rows with one row containing colspan 2's and the other
one with colspan 4's and then hide and show the apporpriate row. This
is working fine but is done in a manner that would cause me to have to
write custom code everytime I want to do this. I actually want to do
it on multiple pages and there were multiple rows within the table
where I needed to apply the same concept. Again, I was able to get it
to work by coding each of the rows twice with the differetn attribute
setting and controlling which ones show with the hide() and show()
functions.

I would like to figure out how to do this dynamically.

Yes, I did eliminate the stupid getElementById code and use jQuery. I
was in a hurry and basically copied the wrong code for the post.

On Dec 17, 1:37 pm, Charlie Griefer charlie.grie...@gmail.com wrote:
 I see where you're changing background colors, but where are you trying to
 change colspans?

 untested, but

      $('myTDelement').attr('colspan', x);

 ... where 'x' is the numeric value, should work.

 also, it's criminal to use document.getElementById() within jQuery.
 $('#element') is so much more elegant :)

 script type=text/javascript
     $(document).ready(function() {
         $('#plusSign').click(function() {
             $('.ba_toggle').toggle();

                if $('#plusSign').html() == +) {
                    $('#plusSign').html('-');
                 $('th.ba_colspan, td.ba_colspan').each(function() {
                     $(this).attr('bgColor','red');
                 });
                } else {
                    $('#plusSign').html('+');
                 $('th.ba_colspan, td.ba_colspan').each(function() {
                     $(this).attr('bgColor','green');
                 });
                }

            });
     });
 /script





 On Thu, Dec 17, 2009 at 11:23 AM, davec dcah...@hyphensolutions.com wrote:
  I am trying to change the colspan attribute on some table cells when
  the user clicks on a button but it is not affecting the table. Perhaps
  someone can tell me what I am doing wrong. Here is my jQuery code:

  script type=text/javascript
  $(document).ready(function() {
    $('#plusSign').click(function(){
       $('.ba_toggle').toggle();
         if(document.getElementById('plusSign').innerHTML=='+')
         {
            document.getElementById('plusSign').innerHTML='-';
            $('th.ba_colspan, td.ba_colspan').each(function(){
                 $(this).attr('bgColor','red');
            });
         }
         else
         {
             document.getElementById('plusSign').innerHTML='+';
             $('th.ba_colspan, td.ba_colspan').each(function(){
                 $(this).attr('bgColor','green');
             });
         }
      });
   });
  /script

 --
 Charlie Grieferhttp://charlie.griefer.com/

 I have failed as much as I have succeeded. But I love my life. I love my
 wife. And I wish you my kind of success.- Hide quoted text -

 - Show quoted text -


[jQuery] Re: SlickGrid updates!

2009-12-17 Thread Tin
The SlickGrid source code has been migrated to GitHub:
http://github.com/mleibman/SlickGrid


Re: [jQuery] Re: SlickGrid updates!

2009-12-17 Thread brian
This is very impressive. One might even call it ... slick. Very slick,
indeed. I really like show tasks percentage slider. And the
SparkLines example. Well done!

On Thu, Dec 17, 2009 at 6:41 PM, Tin michael.leib...@gmail.com wrote:
 The SlickGrid source code has been migrated to GitHub:
 http://github.com/mleibman/SlickGrid



[jQuery] Looking for that plugin that uses scrollTo for product demos...

2009-12-17 Thread kgosser
Hey all,

I saw this site a few months ago that was showing off a new plugin
which used the scrollTo tool to scroll through one screen shot. I
can't seem to find it with a Google search, and I forgot to save it to
my Delicious. Yikes!

I was wondering if this rings a bell for anyone and if you could
direct me to that site?


Thanks!


Re: [jQuery] Re: What is the event when a user presses the enter key anywhere on the page?

2009-12-17 Thread Andre Polykanine
Hello Mike and all,

  Sorry, I also have a question about keypresses.
I need a form to be submitted by pressing Ctrl+Enter. How do I manage
to do that?
Thanks!

-- 
With best regards from Ukraine,
Andre
Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ 
jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: m_elensule

- Original message -
From: Mean Mike mcgra...@gmail.com
To: jQuery (English) jquery-en@googlegroups.com
Date: Thursday, December 17, 2009, 9:06:36 PM
Subject: [jQuery] Re: What is the event when a user presses the enter key  
anywhere on the page?

keypress

$(document).keypress(function(e) {
if ((e.which  e.which == 13) || 
(e.keyCode e.keyCode == 13))
{
// do something
}
});
mean mike
On Dec 17, 2:03 pm, laredotorn...@zipmail.com
laredotorn...@zipmail.com wrote:
 Hi,

 I would like to capture the event of pressing enter anywhere on the
 page, even if the focus of the mouse cursor is not on a text field.
 What event/element am I looking at?

 Thanks, - Dave



Re: [jQuery] prompt before closing dialog

2009-12-17 Thread Shawn

in your buttons definition:

buttons : {
Close : function () {
if (!formChanged()) {
$(#myDialog).dialog(close);
}
else {
$(#confirm).dialog(open);
}

}
}

$(#confirm).dialog({

buttons: {
Yes : function () {
  $(#confirm).dialog(close);
  $(#myDialog).dialog(close);
},
No : function () { $(#confirm).close(); }

}
});

One approach.  Haven't tested this any though... :)

Shawn

Obi1 wrote:

Hi, i'm having some trouble because i'm using a dialog witch has a
form in it where someone can change info about their hotel. this
dialog also has 2 buttons one to close and the other to save changes.
what i'm trying to accomplish is - when someone made sany change and
tries to close de dialog without saving he will be prompt if he really
wants to leave without saving the changes an the dialog only closes if
person choses 'yes'.

when closing the window clicking the 'close' button i can accomplish
this, but i wanted it also to work when closing dialog using the x
button on the top of the dialog.

is this possible?


Re: [jQuery] Re: What is the event when a user presses the enter key anywhere on the page?

2009-12-17 Thread Richard D. Worth
$(document).keypress(function(e) {
  if(e.ctrlKey  e.which == 13) {
$('#myForm').submit();
  }
});

or

$('#myForm').keypress(function(e) {
  if(e.ctrlKey  e.which == 13) {
$(this).submit();
  }
});

- Richard

On Thu, Dec 17, 2009 at 7:40 PM, Andre Polykanine an...@oire.org wrote:

 Hello Mike and all,

  Sorry, I also have a question about keypresses.
 I need a form to be submitted by pressing Ctrl+Enter. How do I manage
 to do that?
 Thanks!

 --
 With best regards from Ukraine,
 Andre
 Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @
 jabber.org
 Yahoo! messenger: andre.polykanine; ICQ: 191749952
 Twitter: m_elensule

 - Original message -
 From: Mean Mike mcgra...@gmail.com
 To: jQuery (English) jquery-en@googlegroups.com
 Date: Thursday, December 17, 2009, 9:06:36 PM
 Subject: [jQuery] Re: What is the event when a user presses the enter key
  anywhere on the page?

 keypress

$(document).keypress(function(e) {
if ((e.which  e.which == 13) ||
 (e.keyCode e.keyCode == 13))
 {
// do something
}
});
 mean mike
 On Dec 17, 2:03 pm, laredotorn...@zipmail.com
 laredotorn...@zipmail.com wrote:
  Hi,
 
  I would like to capture the event of pressing enter anywhere on the
  page, even if the focus of the mouse cursor is not on a text field.
  What event/element am I looking at?
 
  Thanks, - Dave




[jQuery] Superfish License

2009-12-17 Thread Webguy
Hi,

I was hoping to use your code in a commercial Wordpress theme I intend
to sell in an online marketplace.  Is that OK?  I can't find a
license, so I assume its OK to use commercially, but I wanted to check
with you.   I'd be glad to put a link to your site in the code, and
even place a small donation.

Thanks for the great code!

Shaun



[jQuery] SimpleModal problem in IE7

2009-12-17 Thread CommandoS
Hi

My question about Contact Form
http://www.ericmmartin.com/projects/simplemodal-demos/

When I try Contact Form with IE6, Its work on this site. I downloaded
it and try it doesn`t work with IE6.

Like in my website, How Can I Fix this problem in my website ?

www.ctuchicago.com

Left-sidebar in the middle of 3 images are I make it with Contact form
codes. But they doesn`t work with ie6  ie7 ? :(


Re: [jQuery] Re: Jquery does not work in IE8

2009-12-17 Thread Alex Beston
Heres the html I'm using.

!doctype html
html lang=en
head
titledrag  drop/title
link type=text/css href=themes/base/ui.all.css rel=stylesheet /
script type=text/javascript src=js/jquery-1.3.2.js/script
script type=text/javascript src=ui/ui.core.js/script
script type=text/javascript src=ui/ui.draggable.js/script
script type=text/javascript src=ui/ui.droppable.js/script
script type=text/javascript src=script.js/script
link type=text/css href=css/demos.css rel=stylesheet /
style type=text/css
#droppable { background: black; width: 150px; height: 150px; padding: 0.5em;
float: left; margin: 10px; }
/style
script type=text/javascript
 $(document).ready( initialise);
/script
/head
body
div id=droppable/div
/body
/html

// js

var these = [ 'white', 'black', 'orange, 'etc' ];

function makeButtons() {
 for (i in these)
makeWord(these[i]);
}

function makeWord(s) {
var e = $(document.createElement('div'));
e.attr('id', s);
e.append(s);
e.draggable( );
$('body').append(e);
}

function initialise(){
makeButtons();
$(function(){
$(#droppable).droppable({
drop: function( ) { alert('dropped'); }
  });
});
}


[jQuery] (validate) condition subsets (multiple submit buttons)

2009-12-17 Thread Jacob
(abstract)

So, I have a form with multiple submit buttons. The different
submission types require different subsets of data input within a
single form, and therefore have different requirements as to what is
required. All of the examples for the validation plugin involve all
values in a form being validated on the form's submission.

I made an object of the following form to specify what validations
should occur dependent on the submit button.

{
  name of form(1...N): {
name of submit-button(1...N): {
  name of field(1...N) {
[validation conditions]
  }
}
  }
}

I want to validate on submission, but I've come to a mind circus about
how to accomplish that. Essentially I want to mark fields as required
depending on whether the validation event was triggered by a specific
submit button. I'll probably end up creating crafty closure code to
work through this, but I believe this would probably be useful as a
use case for future development.


[jQuery] $.ajax POST on ff3.5 and Chrome

2009-12-17 Thread Anton Koval'
good day guys!

i have next code in my js-script:
$.ajax({
url: 'http://localhost:9090/api?callback=?_=?',
type: 'post',
dataType: 'json',
data: {sites :$.toJSON(in_res),
 out_res_http: $.toJSON(out_res_http),
 out_res_http_www: $.toJSON
(out_res_http_www),
 out_res: $.toJSON(out_res)},
success: function(data) {
alert(data.success);
},
error: function(data){
alert ('error!' +   +data);
}
});
as you see it tries to do post request to my server with some python
controller on it, function works proper way on Safari (one of the
latest versions) and in IE8, but in ff and chrome, browser sends
OPTIONS request. Yeap. i've googled a lot on this issue, but i
couldn't get any clearness for me.

thanks for any of your opinions


Re: [jQuery] Re: Jquery does not work in IE8

2009-12-17 Thread Alex Beston
doh, wrong thread.


[jQuery] AJAX and the Content-Type response header

2009-12-17 Thread MrM
Hi,

Firstly, let me apologize if this has been discussed before. I have
searched the group and couldn't find anything on the subject.

Now, to my question. Am I correct to assume that the jQuery.ajax
function pays no heed to the Content-Type response header it receives
from the server? If so, can I ask why? For instance, if the server
sends 'application/json', it is fairly safe to assume that the
response will be in JSON format and should therefore be eval'd.

I have a situation where I do not know beforehand, what type of data
the server will return, and therefore cannot specify a dataType
parameter. In this case, I would like jQuery to parse the response, if
it receives a 'Content-Type' header of 'application/json', and only
then. If the header received is 'text/html', the response should not
be parsed.

Is there a reason why the 'Content-Type' response header is being
ignored, when the dataType parameter is not specified? Or is this not
the case and I am missing something?

Thanks!


[jQuery] Specifying when the document.ready runs

2009-12-17 Thread stevescotthome
I've got a component which runs some jQuery document.ready functions
on a radiobutton list

Now I need to run some of my own custom jQuery ON TOP of that code
(after it runs)...

Is there anyway to specify that I want my document.ready to run after
its?


[jQuery] adding an active class to nav li tag, based on dir level.

2009-12-17 Thread cadenage
I'm having a problem adding an active class the my navigation li.
I'm trying to use jquery to add this class based on the dir level and
not the file name.  Reason being, each dir is going to have sub
directories and misc html files that will be linked together within
the main dir.

I was trying to use the script detailed in this tutorial:
http://www.cssnewbie.com/using-javascript-to-style-active-navigation-elements/
but it didn't work so well.

my original is only adding the class to the li based on the file
name.

function markActiveLink() {
var currentURL = window.location.toString().split(/);
var currentDIR = currentURL[currentURL.length-2];
//alert(currentDIR);
$(#nav li a).filter(function() {
return $(this).attr(href) == currentURL[currentURL.length-1];
}).parent().addClass(current);

if($(#nav li).hasClass(current) == false) {
//alert(currentDIR);
$(#nav li:nth-child(2)).addClass(current);
}
 }

markActiveLink();


my navigation is kinda like this:
ul id=nav
lia href=../index.htmlInternal Home/a/li
lia href=../members/Members/a/li
lia href=../committees/Committees/a/li
/ul

any help is greatly appreciated!

thank you,
gerald


[jQuery] Livequery not reattaching handlers

2009-12-17 Thread Gremlyn1
I am trying to get this function work, and it does everything it
should EXCEPT reattach the event handlers (which is the whole in using
livequery!). Any ideas?
$j(.versions).livequery('change', function() {
var verid = $j(.versions option:selected);
var prodid = $j(this).attr('id');
$j.ajax({
method: get,
url: ../includes/ajax/release.php,
data: vid=+verid.val()+mdl=+prodid,
beforeSend: function()
{$j('#loading').show('fast');},
complete:  function()
{$j('#loading').hide('fast');},
success: function(json) {
$j('.rel_info').show('slow');
$j('.rel_info').html(json);
}
});
});


[jQuery] Load Superfish menu with AJAX

2009-12-17 Thread Greg-J
I am using Superfish for a 4 tiered menu which, when complete, will
consist of several hundred individual links. As to not be penalized by
the big G, I want to load this menu via AJAX. My question then is, how
would I go about doing this so that the menu is loaded into it's
container div and then superfish() is applied?


[jQuery] Help with draggable / droppable

2009-12-17 Thread Alex Beston
Hi there,

I'm trying to create some words which can be dragged and dropped into a
container.

I've tried to dynamically create some divs each containing a word, and they
can be dragged okay, but when I try to drop, it isnt recognised.

thanks in advance,

Alex

-

Heres the code I have so far:

var these = [ 'red', 'blue', 'green', 'orange',  'white' ];

function makeButtons() {
 for (i in these)
makeWord(these[i]);
}

function makeWord(s) {
var e = $(document.createElement('div'));
e.attr('id', s); // make a div with id orange / white / etc
e.append(s);
e.draggable( );   // make this div draggable
$('body').append(e);
}

function initialise(){
makeButtons();
$(function(){
$(#droppable).droppable({
drop: function( ) { alert('dropped'); }
  });
});
}

// html

head
script type=text/javascript
 $(document).ready( initialise );
/script
/head
body
div id=droppable  /div
/body


-


Re: [jQuery] Checkboxes in Combobox

2009-12-17 Thread Jack Killpatrick
It's not a combo box, but: 
http://abeautifulsite.net/2008/04/jquery-multiselect/


- Jack

jambik wrote:

I'm looking plug-in that allows to put checkboxes into combobox
element.

  





[jQuery] Re: jquery.color.js no longer maintained?

2009-12-17 Thread Dave Methvin
To be sure, you're talking about this plugin?

http://plugins.jquery.com/project/color

The plugins site is due to get a redesign for the jQuery 1.4 in
January and I think that will help some of the plugins that have been
neglected. Maybe we can get some people to adopt the plugins that seem
to be popular but orphaned.



[jQuery] Re: Styling dynamic content

2009-12-17 Thread Jason Kaczmarsky
Ahah, this was the problem I thought i was having. I can't make jQuery
work on dynamic content.

If an element with a class of file is added to the document, like
the previous case, no jQuery event related to that element works.
Ex:
$(.file).click(function(){
alert(this)
});
Nothing is ever alerted if that element is clicked.

Example page:
http://pendarenstudios.com/NEW/file_sel.php
On Dec 17, 10:39 am, Jason Kaczmarsky jkaczmar...@yahoo.com wrote:
 I must have missed something cause I made a new page and rewrote the
 code and it worked fine. Thanks for the help guys.

 On Dec 17, 5:26 am, Richard D. Worth rdwo...@gmail.com wrote:

  Works for me:

 http://jsbin.com/egoto/

  - Richard

  On Wed, Dec 16, 2009 at 8:44 PM, Jason Kaczmarsky 
  jkaczmar...@yahoo.comwrote:

   Yes, I am sure they are the correct class and are showing up properly.

   Button press:
   //loop
   $(#files).append('div class=file'+Files[i]+'/div');
   //end loop

   Firebug:
   div id=files style=display: block;
   div class=filework.txt/div
   div class=fileSAS Guide.txt/div
   /div

   On Dec 16, 7:43 pm, Smith, Allex allex.sm...@chelanpud.org wrote:
The browser should render all the styles no matter when they enter.

Are you sure that the class is assigned to those elements? I would make
   sure by peeking at the rendered html via Firebug.

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
   Behalf Of Jason Kaczmarsky
Sent: Wednesday, December 16, 2009 2:14 PM
To: jQuery (English)
Subject: [jQuery] Styling dynamic content

So I've created a little app which loads some filenames into a div via
an AJAX query. This happens when a user clicks a button, not when the
page loads. Because of this, I cannot style the filenames how I want.
I've tried using CSS to do the trick:

.file{
color: #F00;
}

.file:hover{
cursor:pointer;
color:#000;
}

This CSS colors the filenames red when it loads, but nothing in the
hover event works.

Instead of this, I tried using jQuery to style it.

$(.file).hover(function(){
                $(this).css(background-color,#F00);
        },function(){
                $(this).css(background-color,#000);
        });

This also does not change anything. I assume it is because the element
does not exist when the page is rendered, but later on. Although this
doesn't explain why the text is red when I use the CSS, so I'm a bit
confused. How would I accomplish this?


Re: [jQuery] Re: Styling dynamic content

2009-12-17 Thread Richard D. Worth
See
http://docs.jquery.com/Frequently_Asked_Questions#Why_doesn.27t_an_event_work_on_a_new_element_I.27ve_created.3F

- Richard

On Fri, Dec 18, 2009 at 12:23 AM, Jason Kaczmarsky jkaczmar...@yahoo.comwrote:

 Ahah, this was the problem I thought i was having. I can't make jQuery
 work on dynamic content.

 If an element with a class of file is added to the document, like
 the previous case, no jQuery event related to that element works.
 Ex:
 $(.file).click(function(){
alert(this)
});
 Nothing is ever alerted if that element is clicked.

 Example page:
 http://pendarenstudios.com/NEW/file_sel.php
 On Dec 17, 10:39 am, Jason Kaczmarsky jkaczmar...@yahoo.com wrote:
  I must have missed something cause I made a new page and rewrote the
  code and it worked fine. Thanks for the help guys.
 
  On Dec 17, 5:26 am, Richard D. Worth rdwo...@gmail.com wrote:
 
   Works for me:
 
  http://jsbin.com/egoto/
 
   - Richard
 
   On Wed, Dec 16, 2009 at 8:44 PM, Jason Kaczmarsky 
 jkaczmar...@yahoo.comwrote:
 
Yes, I am sure they are the correct class and are showing up
 properly.
 
Button press:
//loop
$(#files).append('div class=file'+Files[i]+'/div');
//end loop
 
Firebug:
div id=files style=display: block;
div class=filework.txt/div
div class=fileSAS Guide.txt/div
/div
 
On Dec 16, 7:43 pm, Smith, Allex allex.sm...@chelanpud.org
 wrote:
 The browser should render all the styles no matter when they enter.
 
 Are you sure that the class is assigned to those elements? I would
 make
sure by peeking at the rendered html via Firebug.
 
 -Original Message-
 From: jquery-en@googlegroups.com [mailto:
 jquery...@googlegroups.com] On
Behalf Of Jason Kaczmarsky
 Sent: Wednesday, December 16, 2009 2:14 PM
 To: jQuery (English)
 Subject: [jQuery] Styling dynamic content
 
 So I've created a little app which loads some filenames into a div
 via
 an AJAX query. This happens when a user clicks a button, not when
 the
 page loads. Because of this, I cannot style the filenames how I
 want.
 I've tried using CSS to do the trick:
 
 .file{
 color: #F00;
 }
 
 .file:hover{
 cursor:pointer;
 color:#000;
 }
 
 This CSS colors the filenames red when it loads, but nothing in the
 hover event works.
 
 Instead of this, I tried using jQuery to style it.
 
 $(.file).hover(function(){
 $(this).css(background-color,#F00);
 },function(){
 $(this).css(background-color,#000);
 });
 
 This also does not change anything. I assume it is because the
 element
 does not exist when the page is rendered, but later on. Although
 this
 doesn't explain why the text is red when I use the CSS, so I'm a
 bit
 confused. How would I accomplish this?



[jQuery] Re: Styling dynamic content

2009-12-17 Thread Jason Kaczmarsky
Ah, thank you very much.

On Dec 18, 12:29 am, Richard D. Worth rdwo...@gmail.com wrote:
 Seehttp://docs.jquery.com/Frequently_Asked_Questions#Why_doesn.27t_an_ev...

 - Richard

 On Fri, Dec 18, 2009 at 12:23 AM, Jason Kaczmarsky 
 jkaczmar...@yahoo.comwrote:

  Ahah, this was the problem I thought i was having. I can't make jQuery
  work on dynamic content.

  If an element with a class of file is added to the document, like
  the previous case, no jQuery event related to that element works.
  Ex:
  $(.file).click(function(){
                 alert(this)
         });
  Nothing is ever alerted if that element is clicked.

  Example page:
 http://pendarenstudios.com/NEW/file_sel.php
  On Dec 17, 10:39 am, Jason Kaczmarsky jkaczmar...@yahoo.com wrote:
   I must have missed something cause I made a new page and rewrote the
   code and it worked fine. Thanks for the help guys.

   On Dec 17, 5:26 am, Richard D. Worth rdwo...@gmail.com wrote:

Works for me:

   http://jsbin.com/egoto/

- Richard

On Wed, Dec 16, 2009 at 8:44 PM, Jason Kaczmarsky 
  jkaczmar...@yahoo.comwrote:

 Yes, I am sure they are the correct class and are showing up
  properly.

 Button press:
 //loop
 $(#files).append('div class=file'+Files[i]+'/div');
 //end loop

 Firebug:
 div id=files style=display: block;
 div class=filework.txt/div
 div class=fileSAS Guide.txt/div
 /div

 On Dec 16, 7:43 pm, Smith, Allex allex.sm...@chelanpud.org
  wrote:
  The browser should render all the styles no matter when they enter.

  Are you sure that the class is assigned to those elements? I would
  make
 sure by peeking at the rendered html via Firebug.

  -Original Message-
  From: jquery-en@googlegroups.com [mailto:
  jquery...@googlegroups.com] On
 Behalf Of Jason Kaczmarsky
  Sent: Wednesday, December 16, 2009 2:14 PM
  To: jQuery (English)
  Subject: [jQuery] Styling dynamic content

  So I've created a little app which loads some filenames into a div
  via
  an AJAX query. This happens when a user clicks a button, not when
  the
  page loads. Because of this, I cannot style the filenames how I
  want.
  I've tried using CSS to do the trick:

  .file{
  color: #F00;
  }

  .file:hover{
  cursor:pointer;
  color:#000;
  }

  This CSS colors the filenames red when it loads, but nothing in the
  hover event works.

  Instead of this, I tried using jQuery to style it.

  $(.file).hover(function(){
                  $(this).css(background-color,#F00);
          },function(){
                  $(this).css(background-color,#000);
          });

  This also does not change anything. I assume it is because the
  element
  does not exist when the page is rendered, but later on. Although
  this
  doesn't explain why the text is red when I use the CSS, so I'm a
  bit
  confused. How would I accomplish this?


RE: [jQuery] Re: Styling dynamic content

2009-12-17 Thread Dave Maharaj :: WidePixels.com
What about 

$(.file).live('click', function(){
alert(this)
}); 

I load elements dynamically into a page after the original load and can
access their events. For example I have a add new record button, loads a
form saves to the database and updates the current page with the new record.
The new record has edit and delete which are now new to the page as they
were not there when the page originally loaded. If I click them sure enough
my edit form loads or the entry gets deleted.

Maybe Imis-understod what your trying to do.

Dave

-Original Message-
From: Jason Kaczmarsky [mailto:jkaczmar...@yahoo.com] 
Sent: December-18-09 1:54 AM
To: jQuery (English)
Subject: [jQuery] Re: Styling dynamic content

Ahah, this was the problem I thought i was having. I can't make jQuery work
on dynamic content.

If an element with a class of file is added to the document, like the
previous case, no jQuery event related to that element works.
Ex:
$(.file).click(function(){
alert(this)
});
Nothing is ever alerted if that element is clicked.

Example page:
http://pendarenstudios.com/NEW/file_sel.php
On Dec 17, 10:39 am, Jason Kaczmarsky jkaczmar...@yahoo.com wrote:
 I must have missed something cause I made a new page and rewrote the 
 code and it worked fine. Thanks for the help guys.

 On Dec 17, 5:26 am, Richard D. Worth rdwo...@gmail.com wrote:

  Works for me:

 http://jsbin.com/egoto/

  - Richard

  On Wed, Dec 16, 2009 at 8:44 PM, Jason Kaczmarsky
jkaczmar...@yahoo.comwrote:

   Yes, I am sure they are the correct class and are showing up properly.

   Button press:
   //loop
   $(#files).append('div class=file'+Files[i]+'/div');
   //end loop

   Firebug:
   div id=files style=display: block; div 
   class=filework.txt/div div class=fileSAS Guide.txt/div 
   /div

   On Dec 16, 7:43 pm, Smith, Allex allex.sm...@chelanpud.org wrote:
The browser should render all the styles no matter when they enter.

Are you sure that the class is assigned to those elements? I 
would make
   sure by peeking at the rendered html via Firebug.

-Original Message-
From: jquery-en@googlegroups.com 
[mailto:jquery...@googlegroups.com] On
   Behalf Of Jason Kaczmarsky
Sent: Wednesday, December 16, 2009 2:14 PM
To: jQuery (English)
Subject: [jQuery] Styling dynamic content

So I've created a little app which loads some filenames into a 
div via an AJAX query. This happens when a user clicks a button, 
not when the page loads. Because of this, I cannot style the
filenames how I want.
I've tried using CSS to do the trick:

.file{
color: #F00;
}

.file:hover{
cursor:pointer;
color:#000;
}

This CSS colors the filenames red when it loads, but nothing in 
the hover event works.

Instead of this, I tried using jQuery to style it.

$(.file).hover(function(){
                $(this).css(background-color,#F00);
        },function(){
                $(this).css(background-color,#000);
        });

This also does not change anything. I assume it is because the 
element does not exist when the page is rendered, but later on. 
Although this doesn't explain why the text is red when I use the 
CSS, so I'm a bit confused. How would I accomplish this?
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.716 / Virus Database: 270.14.102/2556 - Release Date: 12/17/09
05:00:00