[jQuery] Jörn's autocomplete - cursor position in IE8 with multiple items

2010-02-01 Thread shane
Can't figure out how to fix cursor position with IE8 when adding
multiple items using autocomplete.

After adding the first item, the cursor jumps back to the first
position and doesnt allow you to properly enter your second item.

From Jörn's post there's going to be a list builder to handle this
differentsly with jquery 1.8, but for those using standalone
autocomplete is there a fix for this?

Thanks!!


[jQuery] XML object to JSON

2010-01-24 Thread Shane
Hello,

I am trying to convert an XML object that I have to JSON so I can
store it in the browsers cache for later retrieval -- using
DOMCached.  When I encode the object to JSON using the google json
plugin I get an output like this:

{length:187,0:{jQuery1264367243616:2315},1:
{jQuery1264367243616:2316},2:{jQuery1264367243616:2317},3:
{jQuery1264367243616:2318},4:{jQuery1264367243616:2319},.

where the jQuery are supposed to be sub nodes.  How can I best
encode this XML object to JSON?  Or does anyone know of a better way
to browser cache an XML object?

Thanks,
Shane.


[jQuery] XML print all nodes ( html() )

2010-01-09 Thread Shane
Is there a way to print out the structure of a jQuery xml element...
heres some code

$(xml).find(item).each(function(){
if(myid == $(this).find(id).text()){
  itemsXML = $(this).html() -- trying to do something
like this
 }
}

i would like itemsXML to contain the entire stucture of the xml rather
than the jquery object.  thanks


[jQuery] Re: XML print all nodes ( html() )

2010-01-09 Thread Shane
no go.

On Jan 9, 10:56 pm, John Arrowwood jarro...@gmail.com wrote:
 console.log( $('div/').append( $(itemsXML).clone() ).html() )

 See if that works.

 On Sat, Jan 9, 2010 at 7:27 PM, Shane wishiwasmiss...@gmail.com wrote:
  Is there a way to print out the structure of a jQuery xml element...
  heres some code

  $(xml).find(item).each(function(){
         if(myid == $(this).find(id).text()){
               itemsXML = $(this).html()     -- trying to do something
  like this
          }
  }

  i would like itemsXML to contain the entire stucture of the xml rather
  than the jquery object.  thanks

 --
 John Arrowwood
 John (at) Irie (dash) Inc (dot) com
 John (at) Arrowwood Photography (dot) com
 John (at) Hanlons Razor (dot) com
 --http://www.irie-inc.com/http://arrowwood.blogspot.com/


[jQuery] Re: Is mouse inside a div?

2009-11-16 Thread Shane Riley
You can attach the mouseenter event to the div like this:
$('div').mouseenter(function() { // Do stuff });

Documentation is at http://docs.jquery.com/Events/mouseenter

On Nov 15, 3:30 pm, Tom Lobato tomlob...@gmail.com wrote:
   Hi,
   in first, these days I started to play with jquery and I`m
 impressed, excellent library!
   Well, I already done some cool things, but I can`t find
 how to check wheter the mouse pointer is inside a div.
   Any hints?

   Thank you!


[jQuery] Re: Plugin Authoring Code Example Incorrect

2009-11-08 Thread Shane Riley
I ended up using this syntax instead:
return this.each(function(){});

On Nov 7, 11:43 am, Morten Maxild mmax...@gmail.com wrote:
 'return true' is wrong, you need to return the 'wrapped set' to support 
 chaining. The $().each method does return the 'wrapped set' and you can take 
 advantage of this.

 HTH
 Morten



 -Original Message-
 From: Shane Riley [mailto:shanerileydoti...@gmail.com]
 Sent: Saturday, November 07, 2009 1:19 PM
 To: jQuery (English)
 Subject: [jQuery] Plugin Authoring Code Example Incorrect

 I created a jQuery plugin for the sake of learning the process and got
 it working no problem. In the plugin authoring docs it says that if
 you return true inside the each method, you can continue using jQuery
 chaining. However the code example above has the return this statement
 at the end of the plugin function rather than the each method. While
 quickly reading through this article after creating my plugin to
 ensure I was following best practices, I placed the return true in the
 same spot and my Javascript ceased to run. I tried logging in and
 editing the documentation, however it's locked. Just wanted to let
 everyone know of the mistake in the hopes someone on here has the
 ability to fix it.


Re: [jQuery] Re: Plugin Authoring Code Example Incorrect

2009-11-08 Thread Shane Riley
Thanks Karl. Turns out both worked for me, but I had placed the return  
just outside the plugin function instead of within it.



On Nov 8, 2009, at 1:13 PM, Karl Swedberg wrote:


In the meantime, I changed the wording on that page.

Both of the following will work:
1)
return this.each(function() { /* do something */ });
2)
this.each(function() { /* do something */ });
return this;

--Karl

On Nov 8, 2009, at 12:56 PM, Morten Maxild wrote:


Exactly...looks correct:-)


-Original Message-
From: Shane Riley [mailto:shanerileydoti...@gmail.com]
Sent: Sunday, November 08, 2009 6:44 PM
To: jQuery (English)
Subject: [jQuery] Re: Plugin Authoring Code Example Incorrect

I ended up using this syntax instead:
return this.each(function(){});

On Nov 7, 11:43 am, Morten Maxild mmax...@gmail.com wrote:
'return true' is wrong, you need to return the 'wrapped set' to  
support
chaining. The $().each method does return the 'wrapped set' and  
you can

take advantage of this.


HTH
Morten




-Original Message-
From: Shane Riley [mailto:shanerileydoti...@gmail.com]
Sent: Saturday, November 07, 2009 1:19 PM
To: jQuery (English)
Subject: [jQuery] Plugin Authoring Code Example Incorrect


I created a jQuery plugin for the sake of learning the process  
and got
it working no problem. In the plugin authoring docs it says that  
if
you return true inside the each method, you can continue using  
jQuery
chaining. However the code example above has the return this  
statement
at the end of the plugin function rather than the each method.  
While

quickly reading through this article after creating my plugin to
ensure I was following best practices, I placed the return true  
in the

same spot and my Javascript ceased to run. I tried logging in and
editing the documentation, however it's locked. Just wanted to let
everyone know of the mistake in the hopes someone on here has the
ability to fix it.








[jQuery] Re: border appears around jquery slideshow in IE

2009-11-07 Thread Shane Riley
You can place the images each in a container and use those containers
as the slides instead. Then the Cycle plugin isn't messing around with
the PNG filter applied by your iepngfix.htc. ie:
div id=slideshow
div class=slideimg src=./images/showcase.png alt= //div
div class=slideimg src=./images/showcase2.png alt= //div
/div
Also, be sure to give your slides fixed dimensions. I'm seeing a
common issue with implementing Cycle that causes the images to be much
smaller than actual size at random because a fixed width and height
aren't set in the CSS for them.

On Nov 7, 5:53 am, chulo alexll...@hotmail.com wrote:
 hello,

 I have integrated a jquery slideshow in a webpage which appears correctly in
 mozilla, but when testing in all IE explorers a border appears around the
 image that rotates during the transition.

 http://alexanderlloyd.info/touba/

 (it's the small image halfway down the page)

 Anyone have any ideas?

 Thanks very much fory our help!
 --
 View this message in 
 context:http://old.nabble.com/border-appears-around-jquery-slideshow-in-IE-tp...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: Disabling parent link if children present

2009-09-25 Thread Shane Riley

Are you wanting to just hide the anchor element for link 4 but keep
links 4a to 4c visible? Here's a quick example of that scenario:
$(function()
{
$(ul#nav li ul).each(function(i)
{
$(a:first, $(this).parent()).hide();
});
});

ul id=nav
lia href=#Item 1/a/li
lia href=#Item 2/a/li
li
a href=#Item 3/a
ul
lia href=#Sub 1/a/li
lia href=#Sub 2/a/li
lia href=#Sub 3/a/li
/ul
/li
li
a href=#Item 3/a
ul
lia href=#Sub 1/a/li
lia href=#Sub 2/a/li
lia href=#Sub 3/a/li
/ul
/li
/ul

On Sep 24, 2:00 am, osu onesiz...@googlemail.com wrote:
 Hi,

 Is it possible to 'deactivate'/nullify a top-level link in an
 unordered list if child links exist in that list?

 For example, I have the following:

 - Link 1
 - Link 2
 - Link 3
 - Link 4
  - Link 4a
  - Link 4b
  - Link 4c
 - Link 5

 And I want to knock out Link 4 because it has sub-items.

 Is that possible?

 Thanks,

 osu


[jQuery] Each function gives errors in IE6

2009-09-24 Thread Shane Riley

I've got a simple each function that finds every subnav and assigns it
a vertical position equal to half of the subnav's height. This works
great in all modern browsers, but in IE6 I get errors from each of the
two lines within the function. Here's the problem function:

$(.subnav).each(function(i)
{
top = (parseInt($(this).height()) / 2) - 6;
$(this).css(top, (- + top + px));
});

When I view the page in IE6, I get an error saying Not implemented.
If I comment out the line setting the top variable, I get an error
saying Invalid argument. Initially I was thinking the problem was in
setting the CSS property for top, but now it seems something else is
up.


[jQuery] Each function gives errors in IE6

2009-09-24 Thread Shane Riley

I've got a simple each function that finds every subnav and assigns it
a vertical position equal to half of the subnav's height. This works
great in all modern browsers, but in IE6 I get errors from each of the
two lines within the function. Here's the problem function:

$(.subnav).each(function(i)
{
top = (parseInt($(this).height()) / 2) - 6;
$(this).css(top, (- + top + px));
});

When I view the page in IE6, I get an error saying Not implemented.
If I comment out the line setting the top variable, I get an error
saying Invalid argument. Initially I was thinking the problem was in
setting the CSS property for top, but now it seems something else is
up.


[jQuery] Re: Each function gives errors in IE6

2009-09-24 Thread Shane Riley

Weird double post. Found the issue. For some reason declaring the
variable worked. So I changed it to:
var  top = (parseInt($(this).height()) / 2) - 6;

On Sep 24, 7:31 am, Shane Riley shanerileydoti...@gmail.com wrote:
 I've got a simple each function that finds every subnav and assigns it
 a vertical position equal to half of the subnav's height. This works
 great in all modern browsers, but in IE6 I get errors from each of the
 two lines within the function. Here's the problem function:

 $(.subnav).each(function(i)
         {
                 top = (parseInt($(this).height()) / 2) - 6;
                 $(this).css(top, (- + top + px));
         });

 When I view the page in IE6, I get an error saying Not implemented.
 If I comment out the line setting the top variable, I get an error
 saying Invalid argument. Initially I was thinking the problem was in
 setting the CSS property for top, but now it seems something else is
 up.


[jQuery] Re: jQuery not working with content that is loaded in.

2009-08-11 Thread Shane Riley

If you're using the latest jQuery, you can bind most events with .live
() to ensure that your events are attached when the new content is
loaded in. Note that this doesn't work for all events, though.

On Aug 11, 12:03 pm, cz231 cz2...@gmail.com wrote:
 Hi,

 I'm building an online application, and I want one widget to refresh
 every time a user clicks a certain element. So I wrote a jQuery on
 click listener that initializes the function to reload the widget.
 However, when the widget is reloaded, all of the javascript effects
 stop working for that widget only. It's like I disabled javascript for
 that part of the page only. Javascript still works everywhere else.

 Can any of you jQuery gurus think of a reason why? (preferably one
 with an easy fix :P)


[jQuery] Selector :eq(x) issuing warning in FF

2009-07-02 Thread Shane Riley

When calling this jQuery:

$(#homepage-slides img:eq(0)).fadeOut(300, function() {
$(#homepage-slides img:eq(1)).fadeIn(300, function() { $(#homepage-
slides img:eq(0)).remove(); });
});

I'm getting this warning in the Web Developer toolbar in Firefox:

Warning: Unknown pseudo-class or pseudo-element 'eq'.

It seems to work, however the image preload function I'm calling just
before it isn't functioning and I'm thinking it's because of this
issue. I'm using jQuery 1.3.2. Is there a different syntax to do this
now? If so, then the docs demo is incorrect.


[jQuery] Plugin Newb: Internal Functions

2009-05-15 Thread Shane

First, a thousand pardons! I see several threads that kinda' address
my question, but they're all a little over my head.

On the makeGreen function below, is this an acceptable way to
implement an internal function? If I'm guessing right, we're operating
on an object, so arguments are passed by reference, and this is NOT a
memory leak?

(function(jQuery){

jQuery.fn.ajaxMemo = function(options){

var defaults = {
receivingPage: '/ajax/async-home.php'
};

var options = $.extend(defaults, options);

return this.each(function(){

var obj = $(this);
makeGreen(obj);

});

function makeGreen(obj){
obj.click(function(){
obj.css(backgroundColor,green);
});
}

};

})(jQuery);


[jQuery] Re: Background color is being applied when using Cycle plugin

2009-04-23 Thread Shane Riley

In case anyone was wondering why, here's the solution from Mike Alsup.
Hope it helps anyone else with the issue.

Hi Shane,

There are two cleartype options in Cycle, and unfortunately one of
them is not documented (yet).

The general purpose of the cleartype logic in Cycle is to workaround a
rendering issue in IE when cleartype is enabled on the system.  When a
Windows machine has cleartype enabled, IE6/7 render text aliased when
there is an opacity filter applied to an element.  In IE6, the effects
of this can be greatly minimized if the element in question has an
explicit background color.

When Cycle's 'cleartype' option is true the plugin will attempt to set
a background color on all of the slides to provided better
antialiasing support on IE6.  To determine the best bg color, the
plugin walks up the parent hierarchy until it finds a parent with a
non-transparent background color.  If it doesn't find one then it uses
white.  In addition, when the cleartype option is true the plugin will
always try to remove the opacity filter after the transition
completes, this fixes the aliased text on IE7.

Since Cycle is used in many, many different environments I realized
that there are some cases in which setting a specific background color
is not desirable.  A long time ago I added an option called
'cleartypeNoBg'.  When this option is true Cycle will *not* set a
background color on the slide elements (but it will still remove the
opacity filter after each slide transition).

In Internet Explorer the default value of Cycle's 'cleartype' option
is true in recent versions of the plugin.

So to use the undocumented option you would do this:

$('#slideshow').cycle({
   cleartypeNoBg: true
});

Hope this helps with the problem you're having.

Mike


On Apr 22, 6:00 pm, Shane Riley shanerileydoti...@gmail.com wrote:
 I've been using Mike Alsup's Cycle plugin on a large number of
 projects, and one of the most recent ones is giving me trouble in IE.
 In this example, the slide container seems to have a background color
 applied to it, and there is neither a background property added to it
 nor is there any background property in the CSS for the slide element
 or its children. I finally decided to recreate the effect from scratch
 to make sure it wasn't some strange IE bug or the markup, and the from-
 scratch version works no problem. Here are the two examples, both are
 in the past lectures module:

 http://shaneriley.info/fldc/(with Cycle 
 plugin)http://shaneriley.info/fldc/index_custom.html

 Anyone have any idea why this is happening? I haven't seen this happen
 before, however I may be using a more recent version than usual.


[jQuery] Re: Alternate $.load

2009-04-22 Thread Shane Riley

You can use a number of Ajax functions built in to JQuery depending on
your specific needs. Check them out at http://docs.jquery.com/Ajax. If
all you're looking to do is insert one file into another, load is
normally the way to go, unless you're looking to place the loaded file
before, after, or in between elements rather than inside a placeholder
element.

On Apr 22, 5:50 pm, Colonel tcolo...@gmail.com wrote:
 Is there another way load HTML from a remote file and inject it into
 the DOM (instead of $.load)?


[jQuery] Background color is being applied when using Cycle plugin

2009-04-22 Thread Shane Riley

I've been using Mike Alsup's Cycle plugin on a large number of
projects, and one of the most recent ones is giving me trouble in IE.
In this example, the slide container seems to have a background color
applied to it, and there is neither a background property added to it
nor is there any background property in the CSS for the slide element
or its children. I finally decided to recreate the effect from scratch
to make sure it wasn't some strange IE bug or the markup, and the from-
scratch version works no problem. Here are the two examples, both are
in the past lectures module:

http://shaneriley.info/fldc/ (with Cycle plugin)
http://shaneriley.info/fldc/index_custom.html

Anyone have any idea why this is happening? I haven't seen this happen
before, however I may be using a more recent version than usual.


[jQuery] Re: Alternate $.load

2009-04-22 Thread Shane Riley

Typically you'd only echo the data back that you want instead of
having to weed through a string of HTML data to extract what you need.
From what it looks like, you're needing a specific element from
another page while still being able to access the other page
(temp.php) in its entirety. The easiest solution in this case would be
to send some data to temp.php letting it know that you're initializing
an asynchronous request, and then have the PHP return only what you're
looking for. A quick solution in this case would be something like
this:

$.ajax({url: 'temp.php',
data: ajax=true,
cache: false,
error:  function(msg) {alert(Error Saved:  + msg);},
success: function(msg) {alert(Data Saved:  + msg);},
complete: function() {$.unblockUI();}
   });
Then in temp.php, check for this flag, and if it's true, send the
header2 div only.

?php
$header2 = 'div id=header2pSome text in header2 .../p/div';
if ($_GET[ajax])
{ ?
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
html
head
 titleTest file/title
 meta http-equiv=Content-Type content=text/html;
charset=windows-1251
/head
body
 div id=headerpSome text in div header/p/div
 ?
 $id = isset($_GET[ID]) ? $_GET[ID] : ;
 $number = isset($_GET[NUMBER]) ? $_GET[LOT_NUMBER] : ;
 echo pbid =/b . $id . /p;
 echo pnumber =  . $number . /p;
echo $header2;
 ?
/body
/html
?php } else { echo $header2; } ?

However ideally you'd use a separate PHP function or file altogether
to handle it.


On Apr 22, 8:21 pm, Colonel tcolo...@gmail.com wrote:
 I know it. But how I can get content from remote file by $.ajax?
 For example I have some file temp.php:

 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
 html
 head
  titleTest file/title
  meta http-equiv=Content-Type content=text/html;
 charset=windows-1251
 /head
 body
  div id=headerpSome text in div header/p/div
  ?
  $id = isset($_GET[ID]) ? $_GET[ID] : ;
  $number = isset($_GET[NUMBER]) ? $_GET[LOT_NUMBER] : ;
  echo pbid =/b . $id . /p;
  echo pnumber =  . $number . /p;
  ?
 div id=header2pSome text in header2 .../p/div
 /body
 /html

 and Am using $.ajax:

 $.ajax({url: 'temp.php',
             cache: false,
             error:  function(msg) {alert(Error Saved:  + msg);},
             success: function(msg) {alert(Data Saved:  + msg);},
             complete: function() {$.unblockUI();}
            });

 how I can get for example content only from div with id=header2 ?

 On 23 апр, 01:55, Shane Riley shanerileydoti...@gmail.com wrote:

  You can use a number of Ajax functions built in to JQuery depending on
  your specific needs. Check them out athttp://docs.jquery.com/Ajax. If
  all you're looking to do is insert one file into another, load is
  normally the way to go, unless you're looking to place the loaded file
  before, after, or in between elements rather than inside a placeholder
  element.

  On Apr 22, 5:50 pm, Colonel tcolo...@gmail.com wrote:

   Is there another way load HTML from a remote file and inject it into
   the DOM (instead of $.load)?


[jQuery] Re: SlideToggle Callback Help

2009-04-22 Thread Shane Riley

So what you're trying to do is ensure that the slideToggle is done
animating before you add/remove a class? If so, you'd do something
like this:

$('.open-post-info').click(function() {
var id = $(this).attr('id');
$('.post-info-' + id).slideToggle(medium, function()
{
$(this).toggleClass(toggled);
});
return false;
});

This is where you'd implement the callback, and it's very useful with
animations (all of the effects allow callbacks as the last
parameter).

On Apr 22, 9:08 pm, Chris cpot...@siolon.com wrote:
 I have this simple slide toggle.

 $('.open-post-info').click(function() {
                 var id = $(this).attr('id');
                 $('.post-info-' + id).slideToggle(medium);
                 return false;

 });

 What I want is when I run the function that after it runs to add CSS
 class and when I close/toggle up that the class gets removed.  Help
 please.


[jQuery] Re: 1.3.2 td class selector only picks the first td

2009-04-22 Thread Shane Riley

There's definitely nothing wrong with the JQuery. Can you post a test
case so that we can see all of the pieces to the puzzle?

On Apr 22, 7:07 pm, Richard D. Worth rdwo...@gmail.com wrote:
 Your code looks fine, and I wasn't able to reproduce what you're describing:

 http://jsbin.com/ucaqi

 - Richard

 On Wed, Apr 22, 2009 at 6:18 PM, kape erlend.so...@gmail.com wrote:

  The following code worked fine in 1.2.6 but after upgrading to 1.3.2
  only the first table cell is shown/hidden.

  table
   tr
     td class=morea/td
     td class=moreb/td
     td class=morec/td
     td class=mored/td
   /tr
  /table
  span id=moreLessmore/span

  ...

  jQuery('#moreLess').click(function() {
   if(jQuery(this).text() == 'more') {
     jQuery(this).text('less');
     jQuery('.more').show();
   } else {
     jQuery(this).text('more');
     jQuery('.more').hide();
   }
  });

  Version 1.2.6 used to add style=display: none; when hiding, and
  would remove it when showing.  Version 1.3.2 adds toggles between
  style=display: none; and style=display: table-cell;.  I don't
  think that matters really, what does matter however is that if I alert
  jQuery('.more').length I get 1 not 4.  Am I doing something wrong?
  Thanks.


[jQuery] attr(href) giving full path instead of relative in IE

2009-03-25 Thread Shane Riley

I'm wanting to read in the exact string that's contained in an
anchor's href attribute in order to use it as the POST variable list
for an Ajax call to a PHP script, however in IE6 and 7 the string read
from the href attribute ends up being the absolute path, not just the
href attribute. Here's exactly what's happening:

vars = $(a).attr(href);
alert(vars);

a href=page=2This should return page=2/a

What I get when running locally in all browsers but IE is what is
expected, an alert box with page=2 in it. In IE, I get http://
localhost/page=2. Is there some way to get it to behave either one
way or the other in all browser instances? I really don't want to have
to detect for IE, then extract what I want from the string if it is.


[jQuery] Re: attr(href) giving full path instead of relative in IE

2009-03-25 Thread Shane Riley

Thanks for the article link, but your proposed change isn't valid
JQuery, is it? My exact jQuery code to read in the value looks like
this:
pageID = $(this).attr(href);
Adding what you suggested to make it $(this)[0].attr(href) will not
do anything apart from force the link to be followed.

I think I'm going to have to move the contents of href to rel instead.

On Mar 25, 11:43 am, Martijn Houtman martijn.hout...@gmail.com
wrote:
 On Mar 25, 2009, at 4:32 PM, Shane Riley wrote:





  I'm wanting to read in the exact string that's contained in an
  anchor's href attribute in order to use it as the POST variable list
  for an Ajax call to a PHP script, however in IE6 and 7 the string read
  from the href attribute ends up being the absolute path, not just the
  href attribute. Here's exactly what's happening:

  vars = $(a).attr(href);
  alert(vars);

  a href=page=2This should return page=2/a

  What I get when running locally in all browsers but IE is what is
  expected, an alert box with page=2 in it. In IE, I get http://
  localhost/page=2. Is there some way to get it to behave either one
  way or the other in all browser instances? I really don't want to have
  to detect for IE, then extract what I want from the string if it is.

 http://www.glennjones.net/Post/809/getAttributehrefbug.htmdescribes  
 the issue and gives a solution.

 $(a)[0].href will probably work consistently.

 Regards,
 --
 Martijn.


[jQuery] Re: attr(href) giving full path instead of relative in IE

2009-03-25 Thread Shane Riley

Ha! I looked at your post too fast, and didn't notice that it was pure
Javascript. Sorry. I'll try it and see.

The way I currently have it will not work with javascript turned off
either. I'm doing it this way only because the client is requiring the
user to have Javascript enabled to use the site (it's a backend system
for very specific clients). They want to add all sorts of animations
and effects like everyone wants to do once they see JQuery animations
in action.

On Mar 25, 12:14 pm, Martijn Houtman martijn.hout...@gmail.com
wrote:
 On Mar 25, 2009, at 5:04 PM, Shane Riley wrote:

  Thanks for the article link, but your proposed change isn't valid
  JQuery, is it? My exact jQuery code to read in the value looks like
  this:
  pageID = $(this).attr(href);
  Adding what you suggested to make it $(this)[0].attr(href) will not
  do anything apart from force the link to be followed.

 Well, no. I suggested using:

 pageID = $(this)[0].attr;

 This is plain JavaScript, rather than using jQuery's attr() function.  
 As the article suggests, this works cross-browser.

  I think I'm going to have to move the contents of href to rel instead.

 Well, you could, but I wouldn't; this is not what the rel attribute  
 is meant for. Besides, it would break the anchor when JavaScript is  
 turned off.

 Regards,
 --
 Martijn.


[jQuery] Re: attr(href) giving full path instead of relative in IE

2009-03-25 Thread Shane Riley

Karl, I'm pretty sure I'm reading you right, but are you saying that
by all accounts JQuery should account for this and return the string-
literal value of href and not IE's absolute path? If so, it's not
working properly. I wish I could show you the live code, because it's
probably easier to visualize, but here's the process involved in these
specific anchors appearing before manipulation:
1. User visits page
2. User makes selection from a drop-down
3. Ajax call initialized sending the href attribute as the variables
using a POST request

So in this case, the anchors in the drop-down list are present on page
load and part of the initial DOM structure. That means that if JQuery
is supposed to sort this out for me, it's not. If you meant that I'd
absolutely have to use Javascript's getAttribute(), then I'll try that
and see if it works.

On Mar 25, 1:17 pm, Karl Swedberg k...@englishrules.com wrote:
 Hi Shane,

 IE has a second flag argument for getAttribute that, when set to 2,
 is supposed to get the literal value of the attribute rather than
 their special-sauce value.

 So, this.getAttribute('href', 2) *should* get the relative href.
 (note: no need to do $(this)[0] ; this works just fine)

 jQuery uses that flag internally, so .attr('href') should do the same
 thing:

 var attr = !jQuery.support.hrefNormalized  notxml 
  special
 // Some attributes require a special 
 call on IE
 ? elem.getAttribute( name, 2 )
 : elem.getAttribute( name );

 I believe that this works in every case except when the href is set
 via JavaScript. In that case, I'm not sure anything can be done.

 --Karl

 
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Mar 25, 2009, at 12:21 PM, Shane Riley wrote:



  Ha! I looked at your post too fast, and didn't notice that it was pure
  Javascript. Sorry. I'll try it and see.

  The way I currently have it will not work with javascript turned off
  either. I'm doing it this way only because the client is requiring the
  user to have Javascript enabled to use the site (it's a backend system
  for very specific clients). They want to add all sorts of animations
  and effects like everyone wants to do once they see JQuery animations
  in action.

  On Mar 25, 12:14 pm, Martijn Houtman martijn.hout...@gmail.com
  wrote:
  On Mar 25, 2009, at 5:04 PM, Shane Riley wrote:

  Thanks for the article link, but your proposed change isn't valid
  JQuery, is it? My exact jQuery code to read in the value looks like
  this:
  pageID = $(this).attr(href);
  Adding what you suggested to make it $(this)[0].attr(href) will
  not
  do anything apart from force the link to be followed.

  Well, no. I suggested using:

  pageID = $(this)[0].attr;

  This is plain JavaScript, rather than using jQuery's attr() function.
  As the article suggests, this works cross-browser.

  I think I'm going to have to move the contents of href to rel
  instead.

  Well, you could, but I wouldn't; this is not what the rel attribute
  is meant for. Besides, it would break the anchor when JavaScript is
  turned off.

  Regards,
  --
  Martijn.


[jQuery] Re: attr(href) giving full path instead of relative in IE

2009-03-25 Thread Shane Riley

After replacing $(this).attr(href) with this.getAttribute(href, 2)
I get the same result. If I output the attribute, IE still shows the
absolute path.

On Mar 25, 2:21 pm, Shane Riley shanerileydoti...@gmail.com wrote:
 Karl, I'm pretty sure I'm reading you right, but are you saying that
 by all accounts JQuery should account for this and return the string-
 literal value of href and not IE's absolute path? If so, it's not
 working properly. I wish I could show you the live code, because it's
 probably easier to visualize, but here's the process involved in these
 specific anchors appearing before manipulation:
 1. User visits page
 2. User makes selection from a drop-down
 3. Ajax call initialized sending the href attribute as the variables
 using a POST request

 So in this case, the anchors in the drop-down list are present on page
 load and part of the initial DOM structure. That means that if JQuery
 is supposed to sort this out for me, it's not. If you meant that I'd
 absolutely have to use Javascript's getAttribute(), then I'll try that
 and see if it works.

 On Mar 25, 1:17 pm, Karl Swedberg k...@englishrules.com wrote:

  Hi Shane,

  IE has a second flag argument for getAttribute that, when set to 2,
  is supposed to get the literal value of the attribute rather than
  their special-sauce value.

  So, this.getAttribute('href', 2) *should* get the relative href.
  (note: no need to do $(this)[0] ; this works just fine)

  jQuery uses that flag internally, so .attr('href') should do the same
  thing:

  var attr = !jQuery.support.hrefNormalized  notxml 
   special
  // Some attributes require a 
  special call on IE
  ? elem.getAttribute( name, 2 )
  : elem.getAttribute( name );

  I believe that this works in every case except when the href is set
  via JavaScript. In that case, I'm not sure anything can be done.

  --Karl

  
  Karl Swedbergwww.englishrules.comwww.learningjquery.com

  On Mar 25, 2009, at 12:21 PM, Shane Riley wrote:

   Ha! I looked at your post too fast, and didn't notice that it was pure
   Javascript. Sorry. I'll try it and see.

   The way I currently have it will not work with javascript turned off
   either. I'm doing it this way only because the client is requiring the
   user to have Javascript enabled to use the site (it's a backend system
   for very specific clients). They want to add all sorts of animations
   and effects like everyone wants to do once they see JQuery animations
   in action.

   On Mar 25, 12:14 pm, Martijn Houtman martijn.hout...@gmail.com
   wrote:
   On Mar 25, 2009, at 5:04 PM, Shane Riley wrote:

   Thanks for the article link, but your proposed change isn't valid
   JQuery, is it? My exact jQuery code to read in the value looks like
   this:
   pageID = $(this).attr(href);
   Adding what you suggested to make it $(this)[0].attr(href) will
   not
   do anything apart from force the link to be followed.

   Well, no. I suggested using:

   pageID = $(this)[0].attr;

   This is plain JavaScript, rather than using jQuery's attr() function.
   As the article suggests, this works cross-browser.

   I think I'm going to have to move the contents of href to rel
   instead.

   Well, you could, but I wouldn't; this is not what the rel attribute
   is meant for. Besides, it would break the anchor when JavaScript is
   turned off.

   Regards,
   --
   Martijn.


[jQuery] Re: attr(href) giving full path instead of relative in IE

2009-03-25 Thread Shane Riley

Alright, so your example shows the actual strings for all three values
in Safari, and in IE7(Vista) it shows the absolute path for #3. After
looking back at my code, I'm actually loading in the links via Ajax
when the page is loaded, so they're not in the original document. So
I'm guessing that means having to do string manipulation since there's
no way to grab the actual href string in IE in this case.

Thanks for putting up an example.

On Mar 25, 3:11 pm, Karl Swedberg k...@englishrules.com wrote:
 Hi Shane,

 Yes, I believe you're reading me right. Strange, though. I'm not able  
 to reproduce the problem you're having. Take a look here:

 http://test.learningjquery.com/href.html

 In IE 7 for #1 and #2 $(this).attr('href') is reporting the actual  
 text string of the href attribute while this.href is reporting the  
 fully qualified URL. For #3, in which I injected the link with  
 javascript, they're both reporting the fully qualified URL.

 Which version of IE are you testing in?

 --Karl

 
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Mar 25, 2009, at 2:21 PM, Shane Riley wrote:



  Karl, I'm pretty sure I'm reading you right, but are you saying that
  by all accounts JQuery should account for this and return the string-
  literal value of href and not IE's absolute path? If so, it's not
  working properly. I wish I could show you the live code, because it's
  probably easier to visualize, but here's the process involved in these
  specific anchors appearing before manipulation:
  1. User visits page
  2. User makes selection from a drop-down
  3. Ajax call initialized sending the href attribute as the variables
  using a POST request

  So in this case, the anchors in the drop-down list are present on page
  load and part of the initial DOM structure. That means that if JQuery
  is supposed to sort this out for me, it's not. If you meant that I'd
  absolutely have to use Javascript's getAttribute(), then I'll try that
  and see if it works.

  On Mar 25, 1:17 pm, Karl Swedberg k...@englishrules.com wrote:
  Hi Shane,

  IE has a second flag argument for getAttribute that, when set to 2,
  is supposed to get the literal value of the attribute rather than
  their special-sauce value.

  So, this.getAttribute('href', 2) *should* get the relative href.
  (note: no need to do $(this)[0] ; this works just fine)

  jQuery uses that flag internally, so .attr('href') should do the same
  thing:

                         var attr = !jQuery.support.hrefNormalized   
  notxml  special
                                         // Some attributes require a  
  special call on IE
                                         ? elem.getAttribute( name, 2 )
                                         : elem.getAttribute( name );

  I believe that this works in every case except when the href is set
  via JavaScript. In that case, I'm not sure anything can be done.

  --Karl

  
  Karl Swedbergwww.englishrules.comwww.learningjquery.com

  On Mar 25, 2009, at 12:21 PM, Shane Riley wrote:

  Ha! I looked at your post too fast, and didn't notice that it was  
  pure
  Javascript. Sorry. I'll try it and see.

  The way I currently have it will not work with javascript turned off
  either. I'm doing it this way only because the client is requiring  
  the
  user to have Javascript enabled to use the site (it's a backend  
  system
  for very specific clients). They want to add all sorts of animations
  and effects like everyone wants to do once they see JQuery  
  animations
  in action.

  On Mar 25, 12:14 pm, Martijn Houtman martijn.hout...@gmail.com
  wrote:
  On Mar 25, 2009, at 5:04 PM, Shane Riley wrote:

  Thanks for the article link, but your proposed change isn't valid
  JQuery, is it? My exact jQuery code to read in the value looks  
  like
  this:
  pageID = $(this).attr(href);
  Adding what you suggested to make it $(this)[0].attr(href) will
  not
  do anything apart from force the link to be followed.

  Well, no. I suggested using:

  pageID = $(this)[0].attr;

  This is plain JavaScript, rather than using jQuery's attr()  
  function.
  As the article suggests, this works cross-browser.

  I think I'm going to have to move the contents of href to rel
  instead.

  Well, you could, but I wouldn't; this is not what the rel attribute
  is meant for. Besides, it would break the anchor when JavaScript is
  turned off.

  Regards,
  --
  Martijn.


[jQuery] Re: attr(href) giving full path instead of relative in IE

2009-03-25 Thread Shane Riley

Right, it's not hard, it was just unexpected is all. I guess I've
gotten used to JQuery working the same in all browsers.

I've got it working now with some old-fashioned Javascript. Thanks!

On Mar 25, 3:20 pm, Shane Riley shanerileydoti...@gmail.com wrote:
 Alright, so your example shows the actual strings for all three values
 in Safari, and in IE7(Vista) it shows the absolute path for #3. After
 looking back at my code, I'm actually loading in the links via Ajax
 when the page is loaded, so they're not in the original document. So
 I'm guessing that means having to do string manipulation since there's
 no way to grab the actual href string in IE in this case.

 Thanks for putting up an example.

 On Mar 25, 3:11 pm, Karl Swedberg k...@englishrules.com wrote:

  Hi Shane,

  Yes, I believe you're reading me right. Strange, though. I'm not able  
  to reproduce the problem you're having. Take a look here:

 http://test.learningjquery.com/href.html

  In IE 7 for #1 and #2 $(this).attr('href') is reporting the actual  
  text string of the href attribute while this.href is reporting the  
  fully qualified URL. For #3, in which I injected the link with  
  javascript, they're both reporting the fully qualified URL.

  Which version of IE are you testing in?

  --Karl

  
  Karl Swedbergwww.englishrules.comwww.learningjquery.com

  On Mar 25, 2009, at 2:21 PM, Shane Riley wrote:

   Karl, I'm pretty sure I'm reading you right, but are you saying that
   by all accounts JQuery should account for this and return the string-
   literal value of href and not IE's absolute path? If so, it's not
   working properly. I wish I could show you the live code, because it's
   probably easier to visualize, but here's the process involved in these
   specific anchors appearing before manipulation:
   1. User visits page
   2. User makes selection from a drop-down
   3. Ajax call initialized sending the href attribute as the variables
   using a POST request

   So in this case, the anchors in the drop-down list are present on page
   load and part of the initial DOM structure. That means that if JQuery
   is supposed to sort this out for me, it's not. If you meant that I'd
   absolutely have to use Javascript's getAttribute(), then I'll try that
   and see if it works.

   On Mar 25, 1:17 pm, Karl Swedberg k...@englishrules.com wrote:
   Hi Shane,

   IE has a second flag argument for getAttribute that, when set to 2,
   is supposed to get the literal value of the attribute rather than
   their special-sauce value.

   So, this.getAttribute('href', 2) *should* get the relative href.
   (note: no need to do $(this)[0] ; this works just fine)

   jQuery uses that flag internally, so .attr('href') should do the same
   thing:

                          var attr = !jQuery.support.hrefNormalized   
   notxml  special
                                          // Some attributes require a  
   special call on IE
                                          ? elem.getAttribute( name, 2 )
                                          : elem.getAttribute( name );

   I believe that this works in every case except when the href is set
   via JavaScript. In that case, I'm not sure anything can be done.

   --Karl

   
   Karl Swedbergwww.englishrules.comwww.learningjquery.com

   On Mar 25, 2009, at 12:21 PM, Shane Riley wrote:

   Ha! I looked at your post too fast, and didn't notice that it was  
   pure
   Javascript. Sorry. I'll try it and see.

   The way I currently have it will not work with javascript turned off
   either. I'm doing it this way only because the client is requiring  
   the
   user to have Javascript enabled to use the site (it's a backend  
   system
   for very specific clients). They want to add all sorts of animations
   and effects like everyone wants to do once they see JQuery  
   animations
   in action.

   On Mar 25, 12:14 pm, Martijn Houtman martijn.hout...@gmail.com
   wrote:
   On Mar 25, 2009, at 5:04 PM, Shane Riley wrote:

   Thanks for the article link, but your proposed change isn't valid
   JQuery, is it? My exact jQuery code to read in the value looks  
   like
   this:
   pageID = $(this).attr(href);
   Adding what you suggested to make it $(this)[0].attr(href) will
   not
   do anything apart from force the link to be followed.

   Well, no. I suggested using:

   pageID = $(this)[0].attr;

   This is plain JavaScript, rather than using jQuery's attr()  
   function.
   As the article suggests, this works cross-browser.

   I think I'm going to have to move the contents of href to rel
   instead.

   Well, you could, but I wouldn't; this is not what the rel attribute
   is meant for. Besides, it would break the anchor when JavaScript is
   turned off.

   Regards,
   --
   Martijn.


[jQuery] Re: Malsup's Cycle plugin exhibiting strange behavior

2009-03-12 Thread Shane Riley

This obviously is not a solid, permanent fix, but I found that if I
set the images to a fixed width and height in the CSS it didn't
exhibit this behavior.

On Mar 12, 7:32 am, Mike Alsup mal...@gmail.com wrote:
  hi there, i got the same problem actually appearing on:
  * windows vista home premium
  * firefox 3.0.7
  * cycle core version: 2.56 03-MAR-2009
  * jQuery 1.3.2 (Minified)

  it works fine on:
  * internet explorer 7.

  first image displays nice, all other images are sized down to exactly
  7x15px.

  note: transitions work fine with cycle lite.

 Please post a link so I can take a look.  Thanks.


[jQuery] Re: Malsup's Cycle plugin exhibiting strange behavior

2009-03-12 Thread Shane Riley

That was my initial issue as well, however my client agreed to same-
height images. Does anyone know if a previous version has these
issues? I don't remember ever seeing this happen in the older
versions.

On Mar 12, 8:31 am, id404 ttarp...@googlemail.com wrote:
 @shane: it's not so easy because all images have different sizes.

 i now set the width to 800px in css and jquery. height still remains
 at 15px (added inline by jscript).

 here a link to my dev-server (slow 
 connection):http://id404.dnsalias.net/foto-ketz.de/index.php?page=portrait


[jQuery] Malsup's Cycle plugin exhibiting strange behavior

2009-03-08 Thread Shane Riley

I've got an instance of Mike Alsup's Cycle slideshow working on the
homepage of a project I'm finishing up, and I'm having different
issues with it depending on the browser being used. All of the issues
seem to be happening in Mac only browsers. Here's the site I'm having
trouble with:
http://elixir.biz/coders/marlins/incoming/

The first issue is in FF 3.0.7 on Mac. Occasionally, the first image
appears no problem, however the remaining images show up extremely
small. I tried setting a fixed width and height to the images, but
that didn't have an effect on it.

The other issue is in Safari 3 on Mac. The first image appears, but
after it fades out no other images fade in. After a set amount of
time, the first image shows up again, then it repeats the process.
This happens every time.

Is this an issue with the JQuery?


[jQuery] Re: Malsup's Cycle plugin exhibiting strange behavior

2009-03-08 Thread Shane Riley

That looks to have done it. Thanks!

On Mar 8, 1:12 pm, Mike Alsup mal...@gmail.com wrote:
  The first issue is in FF 3.0.7 on Mac. Occasionally, the first image
  appears no problem, however the remaining images show up extremely
  small. I tried setting a fixed width and height to the images, but
  that didn't have an effect on it.

  The other issue is in Safari 3 on Mac. The first image appears, but
  after it fades out no other images fade in. After a set amount of
  time, the first image shows up again, then it repeats the process.
  This happens every time.

  Is this an issue with the JQuery?

 Can you please try the latest version of the Cycle plugin?  Some
 sizing bugs were fixed in late February.

 http://www.malsup.com/jquery/cycle/download.html

 Mike


[jQuery] Re: Drop down menu disappears when you hover over Cycle slideshow area

2009-03-08 Thread Shane Riley

Nevermind, I've changed it to toggle onclick instead.

On Mar 7, 9:12 am, Shane Riley shanerileydoti...@gmail.com wrote:
 I've tried getting this to work properly in IE with a variety of
 different methods, and none are working. The page in question is 
 here:http://elixir.biz/coders/marlins/incoming/photos.php
 If you hover over the blue team text it will display a drop-down
 menu. However, in IE6 and IE7 once you've moused over the area where
 the drop down menu overlaps the thumbnails, it disappears. Initially I
 thought it may be a z-index issue between it and the Cycle slideshow
 in the thumbnails area, but no combination of absolute, relative, and
 z-index on the elements has any effect. My next course of action was
 to comment out the thumbnails and the main image to see if it worked,
 and it did. However, when commenting out only one of these two areas,
 it no longer works, and it doesn't matter which is commented out.

 I've also tried moving the category drop-down after the rest of the
 markup, tried adding a clearing div between the category area and the
 thumbnails, tried adding/removing all sorts of CSS properties to the
 category list, and none seem to get it working in IE. I'm left
 wondering if this is an issue with my JQuery instead. I tried
 substituting my hover() with mouseover and mouseout, but it behaved
 the same.


[jQuery] Re: Malsup's Cycle plugin exhibiting strange behavior

2009-03-08 Thread Shane Riley

Actually, now the client has said that the issue still appears in FF 3
on Windows. I'm installing a new copy on a virtual machine to test it
now, but is it possible there's still unresolved issues with the
sizing?


[jQuery] Drop down menu disappears when you hover over Cycle slideshow area

2009-03-07 Thread Shane Riley

I've tried getting this to work properly in IE with a variety of
different methods, and none are working. The page in question is here:
http://elixir.biz/coders/marlins/incoming/photos.php
If you hover over the blue team text it will display a drop-down
menu. However, in IE6 and IE7 once you've moused over the area where
the drop down menu overlaps the thumbnails, it disappears. Initially I
thought it may be a z-index issue between it and the Cycle slideshow
in the thumbnails area, but no combination of absolute, relative, and
z-index on the elements has any effect. My next course of action was
to comment out the thumbnails and the main image to see if it worked,
and it did. However, when commenting out only one of these two areas,
it no longer works, and it doesn't matter which is commented out.

I've also tried moving the category drop-down after the rest of the
markup, tried adding a clearing div between the category area and the
thumbnails, tried adding/removing all sorts of CSS properties to the
category list, and none seem to get it working in IE. I'm left
wondering if this is an issue with my JQuery instead. I tried
substituting my hover() with mouseover and mouseout, but it behaved
the same.


[jQuery] Re: field (min, max) depending on other field value

2009-02-18 Thread Shane

You can use jquery.validator (http://bassistance.de/jquery-plugins/
jquery-plugin-validation/) with a custom validation method on the age
field. Here's an example:

//custom validation method
$.validator.addMethod(contextualAgeValidation, function(value,
element, params) {
//see if the first category is selected
if( $(#category).val() == 1 ){
//if so, return true if the age is 30 or more, false if not
return value = 30;
}
return true;
}, Age must be at least 30 if the first category is selected);

Good luck!

On Feb 15, 2:29 pm, petergab adm...@o2.pl wrote:
 1. I have a form and two fields. One is category and one is age. If first
 category is selected the age must be min 30. Is it possible to validate it
 with jQuery?

 2. Second one is similar. I need to set the earliest date in the field
 depending on category.
 --
 View this message in 
 context:http://www.nabble.com/field-%28min%2C-max%29-depending-on-other-field...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Browser locking up -- please help!

2009-02-12 Thread Shane

Thanks for Viewing,

I have one page that locks up all browsers except Mac/Safari. It was
more complex, but I whittled the jQuery code down to the bare
essentials. Even though it's super-simple now, it still hangs for 15
seconds (FireFox is completely non-responsive during this) and ends
with a script loop error message.

Basically, I have a table where users click on a table row to direct
them to that entry's page. (I put the href in the tr title attr)

What in the world is wrong here?

script src='js/jquery.js' type='text/javascript'/script
script type='text/javascript'
//![CDATA[
$(document).ready(function(){

$(#target tr).click(function(){
var title = $(this).attr(title);
window.location.href = title;
});

$(.hideinit).hide();
$(#ajax-load-img).hide();

});

//]]
/script


[jQuery] Creating a reusable Cycle plugin powered slideshow

2009-02-12 Thread Shane Riley

I've got a project where I've got two slideshows on one page, and
they're identical markup. Instead of adding IDs to each and making two
separate cycle references, I wanted to attach the next and previous
slide events on two specific links grouped with the slideshow
container. I'm wondering either how I'm supposed to fire the next or
previous slide event or how to traverse back to the proper links
without an ID.

As an example, here's what I've got for HTML:
div class=slideshow
h2Events/h2
p class=controlsa href=#lt; 
Prev/a | a href=#Next
gt;/a/p
ul
li
img 
src=./images/img_sample.gif alt=Sample /
div class=details
h3a 
href=#Event title/a/h3
pWhen: 
strongDate/strongbr /
Where: 
strongLocation Name/strong/p
pLorem ipsum 
cu tempor laboramus quo, vim quem voluptua
expetenda ad. Per ei dicam noluisse, ne his elit populo meliore, veri
dicta quo ad./p
pa 
href=#Learn more.../a/p
/div
/li
li
img 
src=./images/img_sample.gif alt=Sample /
div class=details
h3a 
href=#Event title/a/h3
pWhen: 
strongDate/strongbr /
Where: 
strongLocation Name/strong/p
pLorem ipsum 
cu tempor laboramus quo, vim quem voluptua
expetenda ad. Per ei dicam noluisse, ne his elit populo meliore, veri
dicta quo ad./p
pa 
href=#Learn more.../a/p
/div
/li
/ul
/div

I have two of these on the page. What I want to do is something like
this:
$(p.controls a:first-child).click(function()
{
$(this).parent().next().cycle(prev);
return false;
});
$(p.controls a:last-child).click(function()
{
$(this).parent().next().cycle(next);
return false;
});
$(.slideshow ul).cycle(
{
fx: fade,
speed: 500,
timeout: 0
});

Is there a way to actually do this, or am I stuck using IDs?


[jQuery] Re: Browser locking up -- please help!

2009-02-12 Thread Shane

One more thing: It begins the timeout/loop condition whenever I try to
leave the page. So, whenever I click a row (utilizing jQuery) OR
whenever I just click a menu link (or even just refreshing the page),
it locks up.

I also looked at the resulting html for the page and it's MASSIVE.
Exactly 18,671 lines! The progress bar shows that loading is complete,
however.

Anyhow, below is the beginning of the table and the first two rows. (I
doubt anyone wants the full 18k lines worth.)

table id=target

tr 
title='index.php?page=prop_descriptionpropid=4'
class='listitem'
td style='width:33%;'1480 Vine St 
amp; 8th, BLDGbr /Daytona
Beach, FL 32117br /ID: 4/td
td style='width:33%;'AA: Shane 
Mills/br /SA: Shane Millsbr /
Home Pro Realty Corp/td
td style='width:33%;'Buy/td
/tr   tr 
title='index.php?page=prop_descriptionpropid=5'
class='listitem'
td style='width:33%;'1011 Surge Ctbr 
/Orlando, FL 32828br /
ID: 5/td
td style='width:33%;'AA: /br /SA: 
Michael Kivitzbr /Home
Pro Realty Corp/td
td style='width:33%;'Buy/td
/tr


[jQuery] Re: Browser locking up -- please help!

2009-02-12 Thread Shane

More: Without filtering the results (pulling every entry from the DB),
there are 4550+- entries.

I'm wondering if it would just be better to write onClick events for
individual row and bypass jQuery altogether here.


[jQuery] Re: Creating a reusable Cycle plugin powered slideshow

2009-02-12 Thread Shane Riley

Actually, I had figured out a solution almost like what you've got
here after your Twitter replies. Here's what I used to make it work:

$(.slideshow ul).each(function()
{
e = $(this);
p = $(p.controls, $(this).parent());
e.cycle(
{
fx: fade,
speed: 500,
timeout: 0,
next: $(a:last-child, p),
prev: $(a:first-child, p)
});
});

I don't like adding classes and IDs unless it's absolutely necessary,
if you couldn't tell from my initial post. Thanks for the help and the
immediate response!


[jQuery] Re: Browser locking up -- please help!

2009-02-12 Thread Shane

Thank you, James!! That did the trick. I guess the browser was just
having a tough time with all those bindings.

Here is what I ended up using:

var link;
$('table#target').click(function(e){

var targ = $(e.target);
if(targ.is(table)){
return;
}else if(targ.is(tr)){
link = targ.attr(title);
}else if(targ.parents(tr).length){
link = targ.parents(tr).eq(0).attr(title);
}
window.location = link;

});


[jQuery] Re: Selection by CSS background-color

2009-01-29 Thread Shane Riley

I'm pretty sure this is going to require using string functions to
locate the background-color property for testing. You could use .css
(background-color) to read in the color attribute, but it will be in
RGB form as shown in the documentation's demo at 
http://docs.jquery.com/CSS/css#name.

First, let's say you've got your divs within a container like this:
div id=sitewrapper
div style=background-color:red;/div
div style=background-color: firebrick;/div
div style=background-color:green;/div
div style=background-color:darkolivegreen;/div
div style=background-color:firebrick;/div
/div

You could then use this to run through each element and test against
its background-color property.
$(document).ready(function()
{
$(#sitewrapper div).each(function()
{
// Grab your style attribute
bgColor = $(this).attr(style);
// Cut from first instance of background-color: on to end
bgColor = 
bgColor.substring((bgColor.indexOf(background-color:) +
17));
// Cut remainder of inline styles, if any
bgColor = bgColor.substring(0, (bgColor.indexOf(;)));
// Remove any whitespace
bgColor = bgColor.replace(/ /g, );
if (bgColor == firebrick)
{
$(this).text(Match);
}
});
});


[jQuery] Re: Thickbox on 1.2.6 or best alternative?

2008-06-08 Thread Shane Graber

Mike:

Can you show your site where you've been using it?

Shane

On Jun 8, 4:44 pm, Mike Alsup [EMAIL PROTECTED] wrote:
  So you should be able to use it with jQuery, no problem.

 Indeed, Shadowbox works quite nicely with jQuery.  I've been using it
 for several months.


[jQuery] Thickbox on 1.2.6 or best alternative?

2008-06-05 Thread Shane Graber
What are people using today to create effects like thickbox or
lightbox on jQuery 1.2.6?  Thickbox is broken on the 1.2.x release and
I'm stuck with an old version of jQuery until I find a suitable
replacement.  What are others using?

-- 
Shane ∞ http://liquid.homelinux.org
-
I'm so cool I can be used to prove Bose-Einstein Condensation!


[jQuery] Re: pass multiple form fields to the $.ajaxFileUpload fileElementId

2008-05-06 Thread Shane

As far as I can tell you have to manually add the desired extra
variables to the url query string, like so:

$.ajaxFileUpload
(
{
url:'ajax_fileUpload.cfm?createpoloroid=' + $
(#createpoloroid).val() + 'createmedium=' + $
(#createmedium).val(),
secureuri:false,
fileElementId:fileToUpload
dataType: 'json',
success: function (data, status)


Good luck...


On Apr 17, 6:27 am, Chris Davies [EMAIL PROTECTED] wrote:
 Hi, I am trying to pass multiple form fields to the ajax_fileUpload.cfm page
 with no success.  Is it possible to send a list of form ID's as I am trying
 below?

 $.ajaxFileUpload
 (
 {
 url:'ajax_fileUpload.cfm',
 secureuri:false,
 fileElementId:*'fileToUpload,createpoloroid,createmedium',*
 dataType: 'json',
 success: function (data, status)

 Thanks!


[jQuery] Ajax loading/please-wait image

2008-04-25 Thread Shane

Hi,

I want to add your typical 'Loading' animated gif to a page while it's
updating via ajax. I'm trying to do this in the $.displayCal function
below. The $('div#load-wait') element is a div with the img inside.

When the page initially loads, I don't see the image at all, even when
$.post takes awhile to load. I see the image if I comment out $
('div#load-wait').hide();

The problem, I'm guessing, is that the image is being hidden before
$.post has a chance to finish.

I know there's an easy solution w/o having to resort to setTimeout,
but I can't figure it out.

Thanks!!

[code]

var curlink;
$.setup = function(){
$('a[rel*=facebox]').facebox();
$(a.cal-changedate).click(function(){
$.displayCal($(this).attr(rel));
});
}

// make rpc call / response
$.displayCal = function(fDate){
$(div#load-wait).show();
$.post(
/async/ajax_calendar.php,
{date: fDate},
function(data, textStatus){
if(textStatus == success){
$(#event-cal).html(data);
$.setup();
}else{
alert(Oops! Communication errors.);
}
});
$(div#load-wait).hide();
};


var today = parseInt(new Date().getTime().toString().substring(0,
10));
$.displayCal(today);
[code]





[jQuery] Re: Ajax loading/please-wait image

2008-04-25 Thread Shane

Thanks. I'll give it a shot.

On Apr 25, 4:30 pm, Ryura [EMAIL PROTECTED] wrote:
 Instead of using $.post, use $.ajax. This has far more options like
 beforeSend which will let you control the timing of your image.

 On Apr 25, 3:29 pm, Shane [EMAIL PROTECTED] wrote:

  Hi,

  I want to add your typical 'Loading' animated gif to a page while it's
  updating viaajax. I'm trying to do this in the $.displayCal function
  below. The $('div#load-wait') element is a div with the img inside.

  When the page initially loads, I don't see the image at all, even when
  $.post takes awhile to load. I see the image if I comment out $
  ('div#load-wait').hide();

  The problem, I'm guessing, is that the image is being hidden before
  $.post has a chance to finish.

  I know there's an easy solution w/o having to resort to setTimeout,
  but I can't figure it out.

  Thanks!!

  [code]

  var curlink;
  $.setup = function(){
  $('a[rel*=facebox]').facebox();
  $(a.cal-changedate).click(function(){
  $.displayCal($(this).attr(rel));
  });

  }

  // make rpc call / response
  $.displayCal = function(fDate){
  $(div#load-wait).show();
  $.post(
  /async/ajax_calendar.php,
  {date: fDate},
  function(data, textStatus){
  if(textStatus == success){
  $(#event-cal).html(data);
  $.setup();
  }else{
  alert(Oops! Communication errors.);
  }
  });
  $(div#load-wait).hide();

  };

  var today = parseInt(new Date().getTime().toString().substring(0,
  10));
  $.displayCal(today);
  [code]


[jQuery] Fisheye menu on left or right of screen?

2007-05-08 Thread Shane

Hi everyone,

Wondering if someone more knowledgeable than me can help me to get the
Fisheye interface element working on the left or right of the screen,
rather than top and bottom.

Thanks,
Shane.