[jQuery] Re: Best practices: Wait to reference objects? Classes like PHP? How do you stay organized with little overhead?

2008-10-05 Thread Micky Hulse

I should also mention:

I would love to write jQuery js like the pseudo PHP/JS example...

Being able to not reference and cache an object until it exists, and
then being able to use that cached object throughout my code,
especially other functions.

(Using class example from my previous post:)
===

class Myclass {

...
...

function someClassMethod2() {
 $foo1 = $this-childObj1;
}

function someClassMethod2() {
 $foo1 = $this-childObj1;
}
...
...

}

===

I like the thought of grabbing a global from a function, that is only
cached when the object exists, and avoiding the need to pass-in
objects via function arguments.

Hrmm, maybe I need to read more about jQuery plugins? :)

Thanks

Cheers,
Micky

On Oct 4, 10:18 am, Micky Hulse [EMAIL PROTECTED] wrote:
 Hello,

 I just have a quick question about jQuery best practices...

 I have been wondering for a while now, is it bad practice for me to
 make references to objects outside of the block of code they are used
 in?

 For example, in my master JS file I might have this code:

 ===

 // Start closure:
 $(function() {

         var $parentObj = $('#parentContianer');
         var $childObj1 = $('#childEle1');
         var $childObj2 = $('#childEle2');
         var $childObj3 = $('#childEle3');
         var $childObj4 = $('#childEle4');
         var $childObj5 = $('#childEle5');
         var $childObj6 = $('#childEle6');

         if($parentObj) { // Parent object exists, execute code block:
                 ... do something with child objects 
         }

 });

 // End closure.

 ===

 HTML:

 ===

 body

 div id=parentContianer
         div id=#childEle1/div
         div id=#childEle2/div
         div id=#childEle3/div
         div id=#childEle4/div
         div id=#childEle5/div
         div id=#childEle6/div
 /div

 /body

 ===

 Should I avoid referencing those child objects only until the parent
 object exists?

 I really like keeping all of my used variables at the top of my JS (so
 I know what vars I am using and such), but I am just not sure how to
 best handle object references... I do not want to do unecessary
 lookups.

 Is there anyway I could do something like a simple PHP class, but with
 JS (psuedo js/php code below):

 ===

 ?php

 class Myclass {

         var $parentObj = $('#parentContianer');
         var $childObj1 = ''
         var $childObj2 = ''
         var $childObj3 = ''
         var $childObj4 = ''
         var $childObj5 = ''
         var $childObj6 = ''

         // Class constructor:
         function Myclass() {
                 if($this-parentObj) {
                         $this-childObj1 = $('#childEle1');
                         $this-childObj2 = $('#childEle2');
                         $this-childObj3 = $('#childEle3');
                         $this-childObj4 = $('#childEle4');
                         $this-childObj5 = $('#childEle5');
                         $this-childObj6 = $('#childEle6');
                         Init(); // Call Init() method.
                 } else { return false; } // If parentObj does not exist, quit.
         }
         function Init() {
                 $foo1 = $this-childObj1;
                 $foo2 = $this-childObj2;
                 ... Do more stuff with the child objects here ...
         }

 }

 ?

 ===

 Basically, I want to keep my code organized and readable... But I also
 want to keep the overhead minimal.

 Hehe, am I making sense here?

 Any tips/advice/links ya'll could send my way would be super
 helpful

 Thanks!
 Cheers,
 Micky Hulse


[jQuery] Re: Ajax/load help with external javascripts

2008-10-05 Thread Rene Veerman


Yep, you'll have to add the javascript nodes in the HTML you're 
inserting into the DIV manually.


WTF, i'll be a nice guy and post my routines for it. you'll have to 
adapt them yourself ;)


   function parseJavascript (htmlElement) {
   var scripts = $('SCRIPT', htmlElement);
  var htmlHead = $('HEAD')[0];
   for (var i=0; iscripts.length; i++) {
   var script = scripts[i];
  
   if (script.src) {

   var scriptsInHead = $('SCRIPT', htmlHead);
   var found = false;
   for (var j=0; jscriptsInHead.length  (!found); j++) {
   if (scriptsInHead[j].src == script.src) found = j;
   }
   var e = document.createElement(script);
   e.type=text/javascript;
   e.language='JavaScript';
   e.src = script.src;
   if (found===false) {
   console.log (mb.desktop.parseJavascript: appending 
+e.src+ to HEAD.);

   htmlHead.appendChild(e);
   } else {
   console.log (mb.desktop.parseJavascript: removing 
then re-adding +e.src+ to HEAD.);
   scriptsInHead[found].parentNode.removeChild 
(scriptsInHead[found]);

   htmlHead.appendChild (e);
   }
   } else {

   var s = scripts[i].innerHTML;
   s = s.replace (/!--/, '');
   s = s.replace (/--/, '');
   s = s.replace (/\s\s/g, '');
//console.log (s);
   eval(s);
   }
   }




Steve wrote:

Hi, I'm a jQuery newbie. Basically, I'm trying to load an html file
into a div when a button is clicked. The html file contains
external .js and .css files for the Greybox widget. I can't get
Greybox working, do I have to do something special to load the js and
css before the load method? Appreciate any help.

--- test.html -

 $(document).ready(function(){
   $(#btn).click(function(){

 $(#demo).load(greybox.html);
   });
 });

--- greybox.html -

script type=text/javascript
var GB_ROOT_DIR = greybox/;
/script

script type=text/javascript src=greybox/AJS.js/script
script type=text/javascript src=greybox/gb_scripts.js/script
link href=greybox/gb_styles.css rel=stylesheet type=text/css /

a href=http://google.com/; title=Google rel=gb_page_fs[]Launch
google.com in fullscreen window/a

  




[jQuery] Putting slideviewer and accordion navigation

2008-10-05 Thread aquaman

Hi,
I'm totally new to javascript yet managed to create accordion
navigation and slideviewer presentation of my portfolio in two
separate html pages.
The problem is I can't seem to put them both on the same page. When I
tried to do that I got the accordion navigation's drawers wide open.
What am I missing?


[jQuery] Re: jQuery validation plugin - Italian Translation

2008-10-05 Thread caruso_g

Thanks a lot for your translation, just some typos/errata:

email: Inserisci un indirizzo mail valido.,
should be
email: Inserisci un indirizzo email valido.,

number: Inserisci un numero valida.,
should be
number: Inserisci un numero valido.,


equalTo: Il valore non coincide.,
could be
equalTo: Il valore non corrisponde.,

accept: Inserisci una valore con una estensione valida.,
should be
accept: Inserisci un valore con unapos;estensione valida.,

maxlength: jQuery.format(Non inserire più di {0}
caratteri.),
should be
maxlength: jQuery.format(Non inserire piugrave; di {0}
caratteri.),

max: jQuery.format(Inserisci un valore minore od uguale a
{0}.),
should be
max: jQuery.format(Inserisci un valore minore o uguale a
{0}.),

min: jQuery.format(Inserisci un valore maggiore od uguale a
{0}.)
should be
min: jQuery.format(Inserisci un valore maggiore o uguale a
{0}.)

Thanks again.


[jQuery] Re: SUPERFISH 1.4.8 need way in superfish's css to extend full width or close to it

2008-10-05 Thread I-CRE8

On Oct 5, 12:47 am, yvonney [EMAIL PROTECTED] wrote:
 Hi...
 Is there a way within the standard superfish css to extend the basic
 horizontal menu fully across the screen from left to right. If so I
 guess it would be great to know if we can have the menus themselves
 left center or right...

Yvonney,

I have an example I am working on here: 
http://development.i-cre8.com/worksheet.php
that has a 100% horizontal width. Feel free to use any off the CSS
modifications that are useful to you.

Th only major issues I have found so far are with IE6 (suprise
suprise) but as this sample is going to be used in a controlled
enviroment that is not so much of an issue for me.

Regards,

Dave Buchholz
I-CRE8 Internet Solutions
http://www.i-cre8.co.uk
Skype: I-CRE8


[jQuery] Re: jQuery cycle and handling new request/page changed

2008-10-05 Thread Jozef Sevcik
Hello Mike,

thanks for your interest. I've extracted it here:
http://www.2ba-me.com/SlideShow.aspx
Open up page and wait few slides. Try to refresh page in browser and after
that,
slideshow starts on last slide from previous page load, but it's stopped.

I'm not following this, do you see something which may cause such behavior ?

Thanks,
Jozef

2008/10/5 Mike Alsup [EMAIL PROTECTED]


  I have a slideshow, which repeats on different pages (for example /
  index-1.html, /index-2.html etc).
  Slideshow is in main template, shared by all other pages.
  What I'm trying to do is if page is changed from index-1 to index-2
  (e.g. user clicks on some link on page),
  slideshow on index-2 will start where slideshow on index-1 ended.
  I'm using cookie for this - storing index of current slide every time
  cycle.after event occurs
  and try to start from this index if cookie is set:


 Can you post a link?




-- 
S pozdravom / Best regards,

Jozef Ševčík
[EMAIL PROTECTED]

+420 608 782 813
+420 222 364 769


[jQuery] Unable to use jquery with Firefox

2008-10-05 Thread samr

I just started on with jquery using
Firefox - 3.0.3
Firebug - 1.2.1

The helloworld example using jquery is not loading with firebug and
just keeps on cycling.
I have disabled all plugins, still the result is same.

The firebug script seems to be stuck at line #679
jQuery.cache[ id ][ name ] :

Following is the html:

html
 
head
 script type=text/javascript src=jquery.js/script
 script type=text/
javascript
   // we will add our javascript code here
 $(document).ready(function() {
   // do stuff when DOM is ready

  $(a).click(function() {
 alert(Hello world!);
   });

 });

 /
script
 /
head
 
body
   !-- we will add our HTML content here --

   a href=Link/a
 /
body
 /html

What am I missing ?

Thanks,

Samy.


[jQuery] Re: Unable to use jquery with Firefox

2008-10-05 Thread me-and-jQuery

Hm... Everything seems to be OK (except break lines in the code).

Try this one, it should work.

html
head
script type=text/javascript src=jquery.js/script
script type=text/javascript
$(document).ready(function() {
$(a).click(function() {
alert(Hello world!);
});
});
/script
/head

body
a href=Link/a
/body
/html


On Oct 5, 8:42 am, samr [EMAIL PROTECTED] wrote:
 I just started on with jquery using
 Firefox - 3.0.3
 Firebug - 1.2.1

 The helloworld example using jquery is not loading with firebug and
 just keeps on cycling.
 I have disabled all plugins, still the result is same.

 The firebug script seems to be stuck at line #679
 jQuery.cache[ id ][ name ] :

 Following is the html:

 html

 head
  script type=text/javascript src=jquery.js/script
  script type=text/
 javascript
// we will add our javascript code here
  $(document).ready(function() {
// do stuff when DOM is ready

   $(a).click(function() {
  alert(Hello world!);
});

  });

  /
 script
  /
 head

 body
!-- we will add our HTML content here --

a href=Link/a
  /
 body
  /html

 What am I missing ?

 Thanks,

 Samy.


[jQuery] Multiple Rows in Jcarousel

2008-10-05 Thread stewie

I was wondering if there was a way to get Jcarousel to slide through
multiple rows of images horizontally.


[jQuery] Only show div's within parent.

2008-10-05 Thread [EMAIL PROTECTED]

This is my first time with jQuery!

I have a list like this:
ul id=results
li
a href=# class=showsome text/a
div class=hiddensome text/div
/li
li
a href=# class=showsome text/a
div class=hiddensome text/div
/li
li
a href=# class=showsome text/a
div class=hiddensome text/div
/li
/ul

And a script like this:
$(document).ready(function(){
$(a.show).click(function () {
$(div.hidden).slideToggle(fast);
});
});

Now when a press one of the links with the class show it does show
every div with the class hidden. But I only want to show the child
div of the link show. Not all of them.

Is that possible and how?


[jQuery] How to trigger ajaxed link before the regular a href?

2008-10-05 Thread ivframes

Hi, I just started learning javascript and jQuery.
I have trouble calling ajaxed link before the usual html stuff for the
javascript-disabled browsers.

The jQuery code:

$(.about a).click(function() {
$(.jq).hide().slideDown(slow).load(about.htm);
});

HTML:
li class=abouta href=about.htmabout/a/li

I tried with some onclick event, but didn't work - html link is
always started before ajax/jquery.

Thanks!


[jQuery] Re: jqueryPngFix and links on IE6

2008-10-05 Thread Fazal Khan

With any PNG fix you use jQuery or not, if the link isn't clickable,
just apply the position:relative; attribute to the link in your css
file and it will work.



On Sep 2, 12:28 pm, Giovanni Battista Lenoci [EMAIL PROTECTED]
wrote:
 Hi, I'm using the pngFix plugin to show some png images with
 trasparency.

 These images are part of a list of menu, and each one is inside on
 link tag.

 When the png fix is applied I can see trasparency but the linkable
 area is restricted to the visible part of the image.
 I've putted an example page here:

 http://lab.gianiaz.com/jquery/menupngfix/

 There's only an image in it with dimensions : 200pxX150px.
 If you look the page with firefox and Internet Explorer 7 you will be
 able to click on the entire area of 200x150px.
 With Internet explorer 6 you'll be able to click only on the black
 part of the image.

 I know that pngfix replaces the image with a span, and I can with some
 selector intercept the click on the parent of the span, but maybe
 there's some css fix to make the entire span area clickable.

 Any suggestion?

 Thank you


[jQuery] Re: Only show div's within parent.

2008-10-05 Thread MorningZ

$(document).ready(function(){
$(a.show).click(function () {
$(this).find(div.hidden).slideToggle(fast);
});

});


On Oct 5, 8:32 am, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 This is my first time with jQuery!

 I have a list like this:
 ul id=results
         li
                 a href=# class=showsome text/a
                 div class=hiddensome text/div
         /li
         li
                 a href=# class=showsome text/a
                 div class=hiddensome text/div
         /li
         li
                 a href=# class=showsome text/a
                 div class=hiddensome text/div
         /li
 /ul

 And a script like this:
 $(document).ready(function(){
         $(a.show).click(function () {
                 $(div.hidden).slideToggle(fast);
         });

 });

 Now when a press one of the links with the class show it does show
 every div with the class hidden. But I only want to show the child
 div of the link show. Not all of them.

 Is that possible and how?


[jQuery] Re: How to trigger ajaxed link before the regular a href?

2008-10-05 Thread MorningZ

This is not true:

html link is always started before ajax/jquery

your ajax request code runs before the browser tries to go off to
about.htm, and there is a hook in there for you to prevent the href
action

$(.about a).click(function() {
  $(.jq).hide().slideDown(slow).load(about.htm);
  return false;
});




On Oct 5, 8:22 am, ivframes [EMAIL PROTECTED] wrote:
 Hi, I just started learning javascript and jQuery.
 I have trouble calling ajaxed link before the usual html stuff for the
 javascript-disabled browsers.

 The jQuery code:

 $(.about a).click(function() {
                 $(.jq).hide().slideDown(slow).load(about.htm);

 });

 HTML:
 li class=abouta href=about.htmabout/a/li

 I tried with some onclick event, but didn't work - html link is
 always started before ajax/jquery.

 Thanks!


[jQuery] Re: jQuery cycle and handling new request/page changed

2008-10-05 Thread Mike Alsup

 thanks for your interest. I've extracted it 
 here:http://www.2ba-me.com/SlideShow.aspx
 Open up page and wait few slides. Try to refresh page in browser and after
 that,
 slideshow starts on last slide from previous page load, but it's stopped.

The problem is that you're passing the startingSlide value as a string
and the plugin is assuming it to be an int.  I'll fix that in the next
version, but for now you can do this:

$('#hps').cycle({
  fx:'fade',
  speed:  3000,
  startingSlide: parseInt(startIndex),
  after: function (curr, next, opts) {
setNext(opts.currSlide);
}
  });
});

Cheers!

Mike



[jQuery] R: [jQuery] Only show div's within parent.

2008-10-05 Thread diego valobra
Hi, another example..

$(document).ready(function(){ 
  
   $('.hidden').hide(0) // just if you want all items closed at the beginning
   
   $('a.show').click(function () {
           
        $('.hidden').slideUp('fast') // just if you want a kind of accordion
    
        $(this).next('div').slideToggle('fast') // it takes just the next div :)

    });
    
});

here is a demo  http://www.pirolab.it/piro_09/slide_up.html

Diego

--- Dom 5/10/08, [EMAIL PROTECTED] [EMAIL PROTECTED] ha scritto:
Da: [EMAIL PROTECTED] [EMAIL PROTECTED]
Oggetto: [jQuery] Only show div's within parent.
A: jQuery (English) jquery-en@googlegroups.com
Data: Domenica 5 ottobre 2008, 14:32

This is my first time with jQuery!

I have a list like this:
ul id=results
li
a href=# class=showsome text/a
div class=hiddensome text/div
/li
li
a href=# class=showsome text/a
div class=hiddensome text/div
/li
li
a href=# class=showsome text/a
div class=hiddensome text/div
/li
/ul

And a script like this:
$(document).ready(function(){
$(a.show).click(function () {
$(div.hidden).slideToggle(fast);
});
});

Now when a press one of the links with the class show it does show
every div with the class hidden. But I only want to show the child
div of the link show. Not all of them.

Is that possible and how?



  Scopri il blog di Yahoo! Mail:
Trucchi, novità e la tua opinione.
http://www.ymailblogit.com/blog

[jQuery] Re: [validate] one form multiple validations

2008-10-05 Thread Jörn Zaefferer
The multipart-way is currently the recommended approach, but its far
from optimal. I recently got some input that would make this much
easier to use, but I don't yet have any working code.

Jörn

On Fri, Oct 3, 2008 at 2:14 PM, dotcomtim [EMAIL PROTECTED] wrote:

 In the validation plugin I am using rules and messages to validate a
 one form which is broken up into multiple steps within the one form.
 Similar to this script http://jquery.bassistance.de/validate/demo/multipart/
 but altered to add custom rules and messages. Here is what I have so
 far.


 $(document).ready(function() {
var v = $('#form').validate({
errorPlacement: function(error, element) {
error.appendTo(element.parent('div').next('div'));
},
rules: {
// validate step one
name: {
required: true
},
company: {
required: true
},
designation: {
required: true
},
address: {
required: true
},
city: {
required: true
},
province: {
required: true
},
postal: {
required: true
},
phone: {
required: true
},
// validate step two
user_name: {
required: true,
minlength: 3,
remote: 'get.php?do=checkName'
},
password: {
minlength: 5
},
password_confirm: {
minlength: 5,
equalTo: '#password'
}
},
messages: {
name: {required: 'A first and last name is required.'},
company: {required: 'A company name is required.'},
designation: {required: 'A designation is required.'},
address: {required: 'A mailing address is required.'},
city: {required: 'A town or city is required.'},
province: {required: 'A province is required.'},
postal: {required: 'A postal code is required.'},
phone: {required: 'A phone number is required.'},
email: {required: 'A valid email address is 
 required.'},
user_name: {required: 'A user name is required.', 
 minlength:
 jQuery.format('A user name should be greater than {0} characters.'),
 remote: jQuery.format('The user name {0} is already taken.')},
password: {rangelength: jQuery.format('Enter at least 
 {0}
 characters.')},
password_confirm: {minlength: jQuery.format('Enter at 
 least {0}
 characters.'), equalTo: 'Enter the same password as above.'}
}
});

$(#step2 .prevbttn).click(function(){
$(#step2).hide();
$(#step1).fadeIn(fast);
});

$(#step3 .prevbttn).click(function(){
$(#step3).hide();
$(#step2).fadeIn(fast);
});

$(.open2).click(function() {
if (v.form()) {
$(#step2).hide();
$(#step3).fadeIn(fast);
}
});

$(.open1).click(function() {
if (v.form()) {
$(#step1).hide();
$(#step2).fadeIn(fast);
}
});
 });

 In step one div I have all the step one fields div id=step1step
 one fields/div
 In step two div I have all the step two fields div id=step2step
 two fields/div

 I if I was to use this without the steps everything works perfect,
 with the steps in validates step and even though step two is hidden it
 still wants to validate it as well.

 Is it possible to validate one form in mulitple sections? I tried the
 remove funtion, I tried altering the multipart script but it seems it
 works based on the accordian plugin and error messages not being
 incorparated like I have above.

 Can we when click on a button input type=button name=formNext1
 id=formNext1 value=Next class=open1 formbttn / only validate a
 section. input type=button name=formNext2 id=formNext2
 value=Next class=open2 formbttn / validate another section?



[jQuery] Re: Can't change accordion auto height

2008-10-05 Thread Jörn Zaefferer
Set autoHeight: false.

Jörn

On Sat, Oct 4, 2008 at 6:55 PM, MaxProxy [EMAIL PROTECTED] wrote:

 Hi

 When accordion is expaned, the height is very large even though there
 may only be 2 links. How can I customise the 'ul class' that is put
 in. I have tried taking out 'clearStyle', but that is not working.

 Thanks



[jQuery] Re: Putting slideviewer and accordion navigation

2008-10-05 Thread Jörn Zaefferer
Could you post a testpage?

Jörn

On Sun, Oct 5, 2008 at 11:47 AM, aquaman [EMAIL PROTECTED] wrote:

 Hi,
 I'm totally new to javascript yet managed to create accordion
 navigation and slideviewer presentation of my portfolio in two
 separate html pages.
 The problem is I can't seem to put them both on the same page. When I
 tried to do that I got the accordion navigation's drawers wide open.
 What am I missing?



[jQuery] Re: jQuery validation plugin - Italian Translation

2008-10-05 Thread Jörn Zaefferer
Could you sent that as file js file to me?

Thanks
Jörn

On Sun, Oct 5, 2008 at 1:58 PM, caruso_g [EMAIL PROTECTED] wrote:

 Thanks a lot for your translation, just some typos/errata:

email: Inserisci un indirizzo mail valido.,
 should be
email: Inserisci un indirizzo email valido.,

number: Inserisci un numero valida.,
 should be
number: Inserisci un numero valido.,


equalTo: Il valore non coincide.,
 could be
equalTo: Il valore non corrisponde.,

accept: Inserisci una valore con una estensione valida.,
 should be
accept: Inserisci un valore con unapos;estensione valida.,

maxlength: jQuery.format(Non inserire più di {0}
 caratteri.),
 should be
maxlength: jQuery.format(Non inserire piugrave; di {0}
 caratteri.),

max: jQuery.format(Inserisci un valore minore od uguale a
 {0}.),
 should be
max: jQuery.format(Inserisci un valore minore o uguale a
 {0}.),

min: jQuery.format(Inserisci un valore maggiore od uguale a
 {0}.)
 should be
min: jQuery.format(Inserisci un valore maggiore o uguale a
 {0}.)

 Thanks again.



[jQuery] Re: jquery code works with firefox but not ie.

2008-10-05 Thread Mantas

try to right:
header('Content-Type: text/xml');
in your php file.
I had the same problem with IE and then i've remembered this magic
line, it solved my problem

On 30 Rugs, 20:33, kelvin pompey [EMAIL PROTECTED] wrote:
 I tried the code without ajax. It works in firefox but not in ie. I modelled
 my code on this example from the sitepoint jquery ajax tutorial.
 html
 head
 titleAJAX with jQuery Example/title
 script type=text/javascript src=jquery-1.2.6.pack.js/script
 script type=text/javascript
 $(document).ready(function(){
 timestamp = 0;

 updateMsg();
 $(form#chatform).submit(function(){
 $.post(backend.php,{
 message: $(#msg).val(),
 name: $(#author).val(),
 action: postmsg,
 time: timestamp}, function(xml) {

 $(#msg).empty();
 addMessages(xml);});
 return false;
 });
 });

 function addMessages(xml) {
 if($(status,xml).text() == 2) return;
 timestamp = $(time,xml).text();
 $(message,xml).each(function(id) {
 message = $(message,xml).get(id);
 $(#messagewindow).prepend(b+$(author,message).text()+
 /b: +$(text,message).text()+
 br /);});
 }

 function updateMsg() {
 $.post(backend.php,{ time: timestamp }, function(xml) {
 $(#loading).remove();
 addMessages(xml);});

 setTimeout('updateMsg()', 4000);}

 /script
 style type=text/css
 #messagewindow {
 height: 250px;
 border: 1px solid;
 padding: 5px;
 overflow: auto;}

 #wrapper {
 margin: auto;
 width: 438px;}

 /style
 /head
 body
 div id=wrapper
 p id=messagewindowspan id=loadingLoading.../span/p
 form id=chatform
 Name: input type=text id=author /
 Message: input type=text id=msg /
 input type=submit value=ok /br /
 /form
 /div
 /body
 /html

 This code works in both firefox and ie. I can't figure out what I am doing
 differently that makes my code not work with ie.

 On Tue, Sep 30, 2008 at 12:53 PM, Eric [EMAIL PROTECTED] wrote:

  I'm a little concerned by this line:
  client = $(client,data).get(id);

  I'd recommend putting a var in front so that you have a local, not a
  global, variable.
  It also seems to me like $(client,data).get(id) is equivalent to
  'this' inside the each.

  so instead of: client = $(client,data).get(id);
  use:  var client = this;

  I've never tried to use jQuery with IE and XML data, so I'm not sure
  what quirks might be caused by that combination.

  I would recommend trying your function without the AJAX call:
  var data = insert_your_xml_here;
  $(client,data).each(function(id) {
                         client = $(client,data).get(id);
                         $(#left_items).append(li id='+$
  (id,client).text()+'a
  href='#'+$(name,client).text()+/a/li);
                 });

  If none of that helps, I'd recommend installing Firebug, and doing
  some heavy console logging (http://getfirebug.com/console.html),
  specifically of the variable 'client'.

  On Sep 30, 12:14 pm, silk.odyssey [EMAIL PROTECTED] wrote:
   I have the following code that works in firefox and google chrome
   using jquery 1.2.6.

   function setUpClient()
   {
           $.post(http://localhost/gestivov2/include/ajax/getclients.php;,
  {},
           function(data){
           $('#left_items').empty();
                   //alert(data);
                   $(client,data).each(function(id) {
                           client = $(client,data).get(id);
                           $(#left_items).append(li
  id='+$(id,client).text()+'a
   href='#'+$(name,client).text()+/a/li);
                   });
           })

   }

   It doesn't work with internet explorer 7, 8 beta nor 6. If I uncomment
   the alert code, the xml data gets displayed so it looks like the code
   within the each block is not being executed. What am i doing wrong?


[jQuery] Re: How to trigger ajaxed link before the regular a href?

2008-10-05 Thread ivframes

Yes, yes thank you!! Works as it should!


On 5 окт, 16:52, MorningZ [EMAIL PROTECTED] wrote:
 This is not true:

 html link is always started before ajax/jquery

 your ajax request code runs before the browser tries to go off to
 about.htm, and there is a hook in there for you to prevent the href
 action

 $(.about a).click(function() {
       $(.jq).hide().slideDown(slow).load(about.htm);
       return false;

 });

 On Oct 5, 8:22 am, ivframes [EMAIL PROTECTED] wrote:

  Hi, I just started learning javascript and jQuery.
  I have trouble calling ajaxed link before the usual html stuff for the
  javascript-disabled browsers.

  The jQuery code:

  $(.about a).click(function() {
                  $(.jq).hide().slideDown(slow).load(about.htm);

  });

  HTML:
  li class=abouta href=about.htmabout/a/li

  I tried with some onclick event, but didn't work - html link is
  always started before ajax/jquery.

  Thanks!


[jQuery] Re: Unable to use jquery with Firefox

2008-10-05 Thread Karl Swedberg

Also, I'd put something in the href value, even if it's just #.

--Karl


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




On Oct 5, 2008, at 9:56 AM, me-and-jQuery wrote:



Hm... Everything seems to be OK (except break lines in the code).

Try this one, it should work.

html
head
script type=text/javascript src=jquery.js/script
script type=text/javascript
$(document).ready(function() {
$(a).click(function() {
alert(Hello world!);
});
});
/script
/head

body
a href=Link/a
/body
/html


On Oct 5, 8:42 am, samr [EMAIL PROTECTED] wrote:

I just started on with jquery using
Firefox - 3.0.3
Firebug - 1.2.1

The helloworld example using jquery is not loading with firebug and
just keeps on cycling.
I have disabled all plugins, still the result is same.

The firebug script seems to be stuck at line #679
jQuery.cache[ id ][ name ] :

Following is the html:

html

head
script type=text/javascript src=jquery.js/script
script type=text/
javascript
  // we will add our javascript code here
$(document).ready(function() {
  // do stuff when DOM is ready

 $(a).click(function() {
alert(Hello world!);
  });

});

/
script
/
head

body
  !-- we will add our HTML content here --

  a href=Link/a
/
body
/html

What am I missing ?

Thanks,

Samy.




[jQuery] Re: SUPERFISH 1.4.8 need way in superfish's css to extend full width or close to it

2008-10-05 Thread yvonney

That is extremely wonderful thank you.
I'll have to have a look at the css as you suggested...


[jQuery] Re: jQuery cycle and handling new request/page changed

2008-10-05 Thread Jozef Sevcik
me=noob
Mike=the man

*Thanks !*


2008/10/5 Mike Alsup [EMAIL PROTECTED]


  thanks for your interest. I've extracted it here:
 http://www.2ba-me.com/SlideShow.aspx
  Open up page and wait few slides. Try to refresh page in browser and
 after
  that,
  slideshow starts on last slide from previous page load, but it's stopped.

 The problem is that you're passing the startingSlide value as a string
 and the plugin is assuming it to be an int.  I'll fix that in the next
 version, but for now you can do this:

 $('#hps').cycle({
  fx:'fade',
  speed:  3000,
   startingSlide: parseInt(startIndex),
   after: function (curr, next, opts) {
setNext(opts.currSlide);
}
  });
 });

 Cheers!

 Mike




-- 
S pozdravom / Best regards,

Jozef Ševčík
[EMAIL PROTECTED]

+420 608 782 813
+420 222 364 769


[jQuery] Re: jquery image highlighter?

2008-10-05 Thread christianslater

thanks for you reply.

I need the highlighter to integrat ein an existing script, that is
loading images sequential one after another and fades them in. So I
thought about the idea of the overlay and think it would be better to
just give all images an alpha of 60% and when rolling over they get to
100%. Can you help me to integrate this into that existing script?

that would be great!

// DOM Ready
$(function () {
// Image Sources
var images = new Array();
images[0] = 'http://imagesource.com/image1.jpg';
images[1] = 'http://imagesource.com/image2.jpg';
images[2] = 'http://imagesource.com/image3.jpg';
// images length
var max = $(images).length;
// at least 1 image exist
if(max0)
{
// create the UL element
var ul = $('ul id=portfolio/ul');
// append to div#wrapper
$(ul).appendTo($('#wrapper'));
// load the first image
LoadImage(0,max);
}

// function of loading image
// params: (int) index of image in array, (int) length of images
array
function LoadImage(index,max)
{
// if current index is lower then max element (max-1)
if(indexmax)
{
// create the LI, add loading class
var list = $('li id=portfolio_'+index+'/
li').attr('class','loading');
// append to UL
$('ul#portfolio').append(list);
// current LI
var curr = $(ul#portfolio
li#portfolio_+index);
// new image object
var img = new Image();
// image onload
$(img).load(function () {
$(this).css('display','none'); //
since .hide() failed in safari
$(curr).removeClass('loading').append(this);
$(this).fadeIn('slow',function(){
// once the current loaded, trigger
the next image
LoadImage(index+1,max);
});
}).error(function () {
// on error remove current
$(curr).remove();
// trigger the next image
LoadImage(index+1,max);
}).attr('src', images[index]);
}
}

});

On 2 Okt., 14:53, BB [EMAIL PROTECTED] wrote:
 Try this:
 $(.overlay-div).hover(function() {
   $(this).fadeTo(fast, 0);}, function() {

   $(this).fadeTo(fast, 0.6);

 });

 On 2 Okt., 09:13, christianslater [EMAIL PROTECTED]
 wrote:

  hi there,
  I`m really new to Javascript and looking for a solution to highlight
  images. So there are small thumbs on the page with an black overlay
  with maybe 60% opacity. If You rollover the image the opacity fades to
  0...

  Can anyone help me?

  thanks in advance!


[jQuery] Re: Unable to use jquery with Firefox

2008-10-05 Thread samr

I tried by removing new lines as well as adding # to href.
It is still the same.

It is strange, with Firebug enabled even the jquery discussion page
at http://docs.jquery.com/Discussion; is not loading.

Not sure if there could be a bug in Firebug.

For time being, I just downloaded Opera and atleast with debug on able
to load the page with Dragonfly on.

Thanks,

Samy Rengasamy.


On Oct 5, 11:29 am, Karl Swedberg [EMAIL PROTECTED] wrote:
 Also, I'd put something in the href value, even if it's just #.

 --Karl

 
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Oct 5, 2008, at 9:56 AM, me-and-jQuery wrote:



  Hm... Everything seems to be OK (except break lines in the code).

  Try this one, it should work.

  html
  head
  script type=text/javascript src=jquery.js/script
  script type=text/javascript
  $(document).ready(function() {
             $(a).click(function() {
                             alert(Hello world!);
             });
  });
  /script
  /head

  body
  a href=Link/a
  /body
  /html

  On Oct 5, 8:42 am, samr [EMAIL PROTECTED] wrote:
  I just started on with jquery using
  Firefox - 3.0.3
  Firebug - 1.2.1

  The helloworld example using jquery is not loading with firebug and
  just keeps on cycling.
  I have disabled all plugins, still the result is same.

  The firebug script seems to be stuck at line #679
  jQuery.cache[ id ][ name ] :

  Following is the html:

  html

  head
  script type=text/javascript src=jquery.js/script
  script type=text/
  javascript
    // we will add our javascript code here
  $(document).ready(function() {
    // do stuff when DOM is ready

   $(a).click(function() {
      alert(Hello world!);
    });

  });

  /
  script
  /
  head

  body
    !-- we will add our HTML content here --

    a href=Link/a
  /
  body
  /html

  What am I missing ?

  Thanks,

  Samy.


[jQuery] jQuery's ajax .load sometimes shows the previous page for a blink of a second?!

2008-10-05 Thread ivframes

Here's the code:

$(function ready() {

// slide'n'ajax
$(.photo).click(function() {
$(.jq).hide().slideDown(slow).load(photo.htm);
$(.closerbutton).show(slow).attr(title, close);
return false;
});
$(.about).click(function() {
$(.jq).slideDown(slow).load(about.htm);
$(.closerbutton).show(slow).attr(title, close);
return false;
});

// close button
$(.closerbutton).click(function() {
$(.jq).hide(slow);
$(this).hide(slow);
});
});

If I open/close the photo.htm page and then click on about.htm, for a
blink of a second I'll see the first one (photo.htm), not the page I
just clicked!

This happens randomly, sometimes every few clicks and sometimes never.
I tried adding .hide() function, but without any success.
It's like it remembers the previous loaded page and mistakenly
displays it for a second and then corrects itself.
No big deal, but kind of annoying.

Is there any command or function that would prevent this from
happening?
Thanks!


[jQuery] Re: jQuery's ajax .load sometimes shows the previous page for a blink of a second?!

2008-10-05 Thread John Resig

Try something like this:
   $(.photo).click(function() {
   $(.jq).hide().load(photo.htm, function(){
$(this).slideDown(slow) });
   $(.closerbutton).show(slow).attr(title, close);
   return false;
   });
   $(.about).click(function() {
   $(.jq).hide().load(about.htm, function(){
$(this).slideDown(slow) });
   $(.closerbutton).show(slow).attr(title, close);
   return false;
   });

You were starting the animation before loading the page - you need to
start it after the loading is complete.

--John



On Sun, Oct 5, 2008 at 3:02 PM, ivframes [EMAIL PROTECTED] wrote:

 Here's the code:

 $(function ready() {

 // slide'n'ajax
$(.photo).click(function() {
$(.jq).hide().slideDown(slow).load(photo.htm);
$(.closerbutton).show(slow).attr(title, close);
return false;
});
$(.about).click(function() {
$(.jq).slideDown(slow).load(about.htm);
$(.closerbutton).show(slow).attr(title, close);
return false;
 });

 // close button
$(.closerbutton).click(function() {
$(.jq).hide(slow);
$(this).hide(slow);
});
 });

 If I open/close the photo.htm page and then click on about.htm, for a
 blink of a second I'll see the first one (photo.htm), not the page I
 just clicked!

 This happens randomly, sometimes every few clicks and sometimes never.
 I tried adding .hide() function, but without any success.
 It's like it remembers the previous loaded page and mistakenly
 displays it for a second and then corrects itself.
 No big deal, but kind of annoying.

 Is there any command or function that would prevent this from
 happening?
 Thanks!



[jQuery] Re: jQuery's ajax .load sometimes shows the previous page for a blink of a second?!

2008-10-05 Thread ivframes

I made such a silly mistake! But again I'm still on the very beginning
of JS/jQ programming.

Thank you for answering so quickly, it works!


On 5 окт, 21:09, John Resig [EMAIL PROTECTED] wrote:
 Try something like this:
        $(.photo).click(function() {
                $(.jq).hide().load(photo.htm, function(){
 $(this).slideDown(slow) });
                $(.closerbutton).show(slow).attr(title, close);
                return false;
        });
        $(.about).click(function() {
                $(.jq).hide().load(about.htm, function(){
 $(this).slideDown(slow) });
                $(.closerbutton).show(slow).attr(title, close);
                return false;
        });

 You were starting the animation before loading the page - you need to
 start it after the loading is complete.

 --John

 On Sun, Oct 5, 2008 at 3:02 PM, ivframes [EMAIL PROTECTED] wrote:

  Here's the code:

  $(function ready() {

  // slide'n'ajax
         $(.photo).click(function() {
                 $(.jq).hide().slideDown(slow).load(photo.htm);
                 $(.closerbutton).show(slow).attr(title, close);
                 return false;
         });
         $(.about).click(function() {
                 $(.jq).slideDown(slow).load(about.htm);
                 $(.closerbutton).show(slow).attr(title, close);
                 return false;
  });

  // close button
         $(.closerbutton).click(function() {
                 $(.jq).hide(slow);
                 $(this).hide(slow);
         });
  });

  If I open/close the photo.htm page and then click on about.htm, for a
  blink of a second I'll see the first one (photo.htm), not the page I
  just clicked!

  This happens randomly, sometimes every few clicks and sometimes never.
  I tried adding .hide() function, but without any success.
  It's like it remembers the previous loaded page and mistakenly
  displays it for a second and then corrects itself.
  No big deal, but kind of annoying.

  Is there any command or function that would prevent this from
  happening?
  Thanks!


[jQuery] Re: Problem with slideUp() in IE7

2008-10-05 Thread Julle

Chris,

On Aug 28, 10:04 pm, Chris [EMAIL PROTECTED] wrote:

 oddly enough, this works great in IE6 (and every other browser I could
 find), just not IE7...

 Any ideas???

First thanks for nailing this bug down to what it actually is, I had a
similar problem and couldn't have solved without your clean code
example.

It turned out to be a variant of the good old peek-a-boo bug, that MS
have been kind enough to make sure is also part of IE7

For me the solution was to set max-width: 0; on the sliding box. See
http://www.brownbatterystudios.com/sixthings/2007/01/06/css-first-aid-for-ie-peekaboo-bug/

Christian Jul
http://mocsystems.com


[jQuery] Jquery and ASP.NET

2008-10-05 Thread eduardo

Is possible use JQuery in aspx pages writing with ASp.net 3.5 ?

Thanks in advance

Eduardo


[jQuery] $(#mydiv).sortable is not a function error

2008-10-05 Thread AdrianMG

Hi guys! I was working with jQuery 1.2.6 development and firebug didnt
report me anybug. Now I am trying to move to 1.2.6 production, but
firebug reports me 2 erros related with $(somediv).sortable is not
a function... What can I do? :S


[jQuery] Re: $(#mydiv).sortable is not a function error

2008-10-05 Thread GARIL


 somediv should be preceded either by # or . like so...

$(#somediv);
or
$(.somediv);


On Oct 5, 4:00 pm, AdrianMG [EMAIL PROTECTED] wrote:
 Hi guys! I was working with jQuery 1.2.6 development and firebug didnt
 report me anybug. Now I am trying to move to 1.2.6 production, but
 firebug reports me 2 erros related with $(somediv).sortable is not
 a function... What can I do? :S


[jQuery] jCarousel Lite - Problem going backwards

2008-10-05 Thread will

Hi jQuery Land,

I'm using jCarousel Lite to do a little tips switcher. I'm using prev
and next buttons.  Next works great.  Prev fails after a few clicks.

The html is straight forward.  jC lite is applied to a div with a set
width and overflow:hidden.  This contains a UL with 4 LIs with a set
width of 190px each.

According to firebug, the issue appears to be the inline css being
applied to the ul. After a few clicks (and sometimes on the first one
- see below), the css on the ul comes up as ... width: 1140px; left:
-2090px; and no matter how many times I click the next/prev buttons,
I can't get anything else to show up again. fwiw, the ul starts with
these inline: ...  width: 1140px; left: -190px;

If I click back first, it goes to directly to ... width: 1140px;
left: -2090px; and we're left with a blank carousel. If I hit next
once and then back, it works for the 4 items, then back to the first
again and then goes to blank.  (left on the ul is set to -190, -380,
-570, -760, -950 (first item) and then -2090!  heep? :)

Sadly, I can't send a url for sorta silly NDA reasons but I'll include
the (I hope) relevant bits of code here.

in the js
$(#did-you-know .container ).jCarouselLite({
btnNext: .prev,
btnPrev: .next,
visible: 1
 });

css
#did-you-know .container {
overflow: hidden;
width: 190px;
}
#did-you-know ul {
margin:0;
padding:0;
display: block;
}
#did-you-know li{
margin: 0;
padding:0;
width:190px;
}



Thanks for any help!
Will

PS. sorry if this gets posted twice.


[jQuery] Re: Accordian menu + FadeIn - some weirdness...can someone help me?

2008-10-05 Thread Alex

i have managed to pull this off pretty well, with no apparent
glitch's

http://www.renderrobot.com/?p=33

as explained to make it load closed just remove the open class from
the html, should do the trick


On Sep 12, 8:34 pm, Rob Fletcher [EMAIL PROTECTED] wrote:
 Noone knows how to stabilize the animation and make this run better?

 On Fri, Sep 12, 2008 at 11:42 AM, RFletcher [EMAIL PROTECTED]wrote:

  I am making an accordian menu with 4 main buttons.  All buttons should
  be closed at start. When you click 1 button the content area should
  slide down and then the content should fade-in.  I have for the most
  part written the script to create this effect however i see some
  glitches with it.  When you click the next tab i can see the two
  buttons at the bottom moving up and down slightly.  Its not a huge
  deal, but i would rather them not move at all. I only want the button
  i click to move.

  Here is my script, please let me know if there is a better way to
  write this as many google searches didn't reveal anything good.  I'm
  sure someone else has wanted to make an accordian menu (slide and then
  fade-in) effect.

  $(document).ready(function() {
  $(dd).hide();
  $(span).hide();

  $(dt a).click(function () {

  $(span).fadeOut(100);

         $(dd:visible).slideUp(slow);

         $(this).parent().next().slideDown(slow, function () {
                 $(span).fadeIn(slow);
                 });
                 return false;
     });
  });

  And my HTML code looks like this:

  dl
         dta href=# class=button1/a/dt
         dd
         div id=ContentBox
     span class=msg_body
     div id=box1
     h1Loreum Ipsum/h1
     pFuturum veniam est claritatem lorem lorem. Sequitur legunt
  consequat qui Investigationes Investigationes. Ut quam me gothica
  dolore ut. Dynamicus est aliquip aliquip tincidunt accumsan. Nunc qui
  et dolor lectores hendrerit. Sequitur mutationem blandit hendrerit.
  facilisis et nis4/p

         h1Loreum Ipsum/h1
         pZzril legere quam lectorum parum hendrerit. Iriure exerci option
  euismod futurum etiam. Ut nostrud praesent qui aliquip luptatum.
  Consectetuer eodem aliquam iriure nulla lectorum. Eum aliquip
  hendrerit et ut eodem. Dynamicus claritatem placerat.  facilisis et
  nis4/p
     /div
     /span
     /div
         /dd
  /dl

  dl
         dta href=# class=button2/a/dt
         dd
         div id=ContentBox
     span class=msg_body
     div id=box2
     h1Loreum Ipsum/h1
     pFuturum veniam est claritatem lorem lorem. Sequitur legunt
  consequat qui Investigationes Investigationes. Ut quam me gothica
  dolore ut. Dynamicus est aliquip aliquip tincidunt accumsan. Nunc qui
  et dolor lectores hendrerit. Sequitur mutationem blandit hendrerit.
  facilisis et nis4/p

         h1Loreum Ipsum/h1
         pZzril legere quam lectorum parum hendrerit. Iriure exerci option
  euismod futurum etiam. Ut nostrud praesent qui aliquip luptatum.
  Consectetuer eodem aliquam iriure nulla lectorum. Eum aliquip
  hendrerit et ut eodem. Dynamicus claritatem placerat.  facilisis et
  nis4/p
     /div
     /span
     /div
         /dd
  /dl

  dl
         dta href=# class=button3/a/dt
         dd
         div id=ContentBox
     span class=msg_body
     div id=box3
     h1Loreum Ipsum/h1
     pFuturum veniam est claritatem lorem lorem. Sequitur legunt
  consequat qui Investigationes Investigationes. Ut quam me gothica
  dolore ut. Dynamicus est aliquip aliquip tincidunt accumsan. Nunc qui
  et dolor lectores hendrerit. Sequitur mutationem blandit hendrerit.
  facilisis et nis4/p

         h1Loreum Ipsum/h1
         pZzril legere quam lectorum parum hendrerit. Iriure exerci option
  euismod futurum etiam. Ut nostrud praesent qui aliquip luptatum.
  Consectetuer eodem aliquam iriure nulla lectorum. Eum aliquip
  hendrerit et ut eodem. Dynamicus claritatem placerat.  facilisis et
  nis4/p
     /div
     /span
     /div
         /dd
  /dl

  dl
         dta href=# class=button4/a/dt
         dd
         div id=ContentBox
     span class=msg_body
     div id=box4
     h1Loreum Ipsum/h1
     pFuturum veniam est claritatem lorem lorem. Sequitur legunt
  consequat qui Investigationes Investigationes. Ut quam me gothica
  dolore ut. Dynamicus est aliquip aliquip tincidunt accumsan. Nunc qui
  et dolor lectores hendrerit. Sequitur mutationem blandit hendrerit.
  facilisis et nis4/p

         h1Loreum Ipsum/h1
         pZzril legere quam lectorum parum hendrerit. Iriure exerci option
  euismod futurum etiam. Ut nostrud praesent qui aliquip luptatum.
  Consectetuer eodem aliquam iriure nulla lectorum. Eum aliquip
  hendrerit et ut eodem. Dynamicus claritatem placerat.  facilisis et
  nis4/p

     /div
     /span
     /div
         /dd
  /dl


[jQuery] Re: Processing.js Google Group Now Formed!

2008-10-05 Thread Rey Bango


Rick

You should probably post this qustion in the processing.js Google Group. :)

Rey...

Rick Faircloth wrote:


Sounds interesting... I saw the example images John has in the repository,
but are there any online working apps using it?

Thanks,

Rick

chris thatcher wrote:
Processing.js ( http://github.com/jeresig/processing-js/ ) is written 
by John Resig and is a port of the Processing language ( 
http://processing.org ) developed at MIT that uses the Html Canvas ( 
http://en.wikipedia.org/wiki/Canvas_(HTML_element) 
http://en.wikipedia.org/wiki/Canvas_%28HTML_element%29 )


It is a very sexy 2D drawing API that allows developers to create rich 
visualizations, and via excanvas.js, is supported by all browsers 
(needs some work based on my experience).


I spent a few hours on the train and wrote a 75 line routine to 
produce Heat Maps on top of Google Maps, it can be used to render 
beautiful charts, manipulate images, etc, etc.
It's a big win for the javascript community and John's skills show 
clearly in it's simplicity and it's completeness.


Thatcher

On Sat, Oct 4, 2008 at 9:26 PM, Rick Faircloth 
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:



Ok...I'll ask...what is Processing.js about?

Rick

chris thatcher wrote:

I started using processing.js also, I'll definitely join this
group!

Thatcher

On Sat, Oct 4, 2008 at 7:16 PM, F1LT3R
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:


   Hey Joe,

   I love using Processing so I am glad you started this group
and I will
   definitely be subscribing.
   You have a question? I have been digging around in the
Processing.js
   for a while now and am quite familiar with the Java Processing
   language, so maybe I could help?

   Thanks,

   Al



   On Sep 24, 1:36 pm, Joe [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
   mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
Head here:
   
http://groups.google.com/group/processingjs
   
And discuss!  I already have one question and don't want
to post it
here on the jQuery board so I figured I'd go ahead and
create the
group.
   
Cheers.
   
Joe




-- Christopher Thatcher





--
Christopher Thatcher





[jQuery] jCarousel Lite - callback function returning an array, but how do I get inside?

2008-10-05 Thread [EMAIL PROTECTED]

I am loving the jCarousel Lite plugin, but I need to be able to
control an FLV player that is in the currently displayed list item.
Because I have 2 FLV players, and I need to stop only the playing one
when the carousel changes to the next slide.

I know that there are callback functions that return a jquery object
that selects all the visible items in the carousel, but I don't know
how to get into that object. Which is a failing of my jquery knowledge
more than anything :

So can anyone help? I've done a bit of searching for jquery array
stuff, but haven't found anything useful for this particular case.

Thanks for your time.



[jQuery] Re: [validate] required( dependency-expression ) for select

2008-10-05 Thread Jörn Zaefferer
Something like this, assuming the textarea with name myTextarea and
a checkbox with id myCheckbox:

$(#myForm).validate({
  rules: {
myTextarea: {
  required: #myCheckbox:checked
}
  }
});

You can basically use any jQuery-selector as the expression. If it
returns no elements, the element isn't be required, otherwise it is.

Jörn

On Mon, Oct 6, 2008 at 12:26 AM, Vic [EMAIL PROTECTED] wrote:

 Hello all, i have a question in regard to jquery validate plugin. i am
 using an select control and for certain option value a user select , a
 textarea control will appear on the form, and i need to validate this
 textarea control. so i tried to use required(dependency-expression) to
 check only when a certain value is selected, the textarea control is
 set to required. i am not quite sure what to put in the rules
 section to trigger the validation.

 Any help will be great,

 Thanks in advance.

 Vic



[jQuery] Re: Unable to use jquery with Firefox

2008-10-05 Thread samr

Finally I uninstalled and installed Firefox again. Now jquery is
loading with Firebug fine.
Not sure which one of the following plugins prevented earlier:

Google Gears
GreaseMonkey
IE Tab
MeeTimer
Password Exporter
Pencil
ReadItlater
Regular Expressions Tester
Smart Desktop Connector
Smush It
Stylish
Wired Marker
YSlow

Thanks for the suggestions.

On Oct 5, 12:43 pm, samr [EMAIL PROTECTED] wrote:
 I tried by removing new lines as well as adding # to href.
 It is still the same.

 It is strange, with Firebug enabled even the jquery discussion page
 at http://docs.jquery.com/Discussion; is not loading.

 Not sure if there could be a bug in Firebug.

 For time being, I just downloaded Opera and atleast with debug on able
 to load the page with Dragonfly on.

 Thanks,

 Samy Rengasamy.

 On Oct 5, 11:29 am, Karl Swedberg [EMAIL PROTECTED] wrote:

  Also, I'd put something in the href value, even if it's just #.

  --Karl

  
  Karl Swedbergwww.englishrules.comwww.learningjquery.com

  On Oct 5, 2008, at 9:56 AM, me-and-jQuery wrote:

   Hm... Everything seems to be OK (except break lines in the code).

   Try this one, it should work.

   html
   head
   script type=text/javascript src=jquery.js/script
   script type=text/javascript
   $(document).ready(function() {
              $(a).click(function() {
                              alert(Hello world!);
              });
   });
   /script
   /head

   body
   a href=Link/a
   /body
   /html

   On Oct 5, 8:42 am, samr [EMAIL PROTECTED] wrote:
   I just started on with jquery using
   Firefox - 3.0.3
   Firebug - 1.2.1

   The helloworld example using jquery is not loading with firebug and
   just keeps on cycling.
   I have disabled all plugins, still the result is same.

   The firebug script seems to be stuck at line #679
   jQuery.cache[ id ][ name ] :

   Following is the html:

   html

   head
   script type=text/javascript src=jquery.js/script
   script type=text/
   javascript
     // we will add our javascript code here
   $(document).ready(function() {
     // do stuff when DOM is ready

    $(a).click(function() {
       alert(Hello world!);
     });

   });

   /
   script
   /
   head

   body
     !-- we will add our HTML content here --

     a href=Link/a
   /
   body
   /html

   What am I missing ?

   Thanks,

   Samy.


[jQuery] Need solution to cycle through images and display a caption

2008-10-05 Thread deronsizemore


Hi,

I'm looking for plugin that will allow cycling through images and display a
caption for each image. What I'm looking for is exactly like this example:
http://www.woothemes.com/demo/?t=3

The image on the top left cycles through different images and displays a
unique caption for each image. Is there anything out there like this for
jQuery? I believe the example above used this mootools plugin I believe:
http://smoothgallery.jondesign.net/getting-started/gallery-set-howto/

Currently, I'm using jQuery Innerfade to cycle through images, but I'm
having to manually insert captions via Photoshop and it's just getting to be
a bit tedious.

Thanks 
-- 
View this message in context: 
http://www.nabble.com/Need-solution-to-cycle-through-images-and-display-a-caption-tp19830233s27240p19830233.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Intercept Back button click on browser

2008-10-05 Thread Dave Methvin

The history plugins can handle that situation, you just have to update
the hash in the URL to keep track of the state of the page. It takes
some study to understand how it works, but believe me you will want to
use it. There is no way to trap the back button, the only other
thing you can do is set an onunload handler and that is really a last-
ditch thing to prevent the user losing data.




[jQuery] $().each() only iterates through first item

2008-10-05 Thread sydneyos

I have the following expression where is_preferred_email is a class
assigned to three elements in my page:

$j(.is_preferred_email).each(
function(i) {
this[i].checked = false;
}
);

if I put alert(this[i].name); in the function, I only ever get one
message, which is consistent w/ the checking/unchecking behavior I
see.

Likewise, a call to $j(.is_preferred_email).size() returns 1.

alert(j$(is_preferred_email)) gives me

[object HtmlInputElement],[object HtmlInputElement],[object
HtmlInputElement]

so clearly it is finding all three items.

I'm stumped.

I am also using prototype but have called var $j =
jQuery.noConflict();

I'm sure I'm missing something obvious - hope someone can pick it out.

Thanks,



[jQuery] Re: Jquery and ASP.NET

2008-10-05 Thread [EMAIL PROTECTED]

Sure. Check our corporate page : spina.com.tr. It's built on .net 3.5
 jQuery 1.2.6

(See html source code to understand how we use it.)

On Oct 5, 9:45 pm, eduardo [EMAIL PROTECTED] wrote:
 Is possible use JQuery in aspx pages writing with ASp.net 3.5 ?

 Thanks in advance

 Eduardo


[jQuery] Re: $().each() only iterates through first item

2008-10-05 Thread MorningZ

There is absolutely no way you have the selector setup correctly

what is the HTML?



On Oct 5, 8:53 pm, sydneyos [EMAIL PROTECTED] wrote:
 I have the following expression where is_preferred_email is a class
 assigned to three elements in my page:

         $j(.is_preferred_email).each(
             function(i) {
                 this[i].checked = false;
             }
         );

 if I put alert(this[i].name); in the function, I only ever get one
 message, which is consistent w/ the checking/unchecking behavior I
 see.

 Likewise, a call to $j(.is_preferred_email).size() returns 1.

 alert(j$(is_preferred_email)) gives me

 [object HtmlInputElement],[object HtmlInputElement],[object
 HtmlInputElement]

 so clearly it is finding all three items.

 I'm stumped.

 I am also using prototype but have called var $j =
 jQuery.noConflict();

 I'm sure I'm missing something obvious - hope someone can pick it out.

 Thanks,


[jQuery] jQuery UI Refresh Baltimore Presentation

2008-10-05 Thread Benjamin Sterling
Hey all,
Just wanted to put it out there that this Wednesday we (Refresh Baltimore)
will be have our (jQuery) lovable Richard Worth doing a jQuery UI
presentation at Refresh Baltimore.  Check out
http://upcoming.yahoo.com/event/1176430 for all pertinent information.

-- 
Benjamin Sterling
Twitter: bmsterling
Web:
http://www.KenzoMedia.com
http://www.KenzoHosting.com
http://www.BenjaminSterling.com


[jQuery] Re: Jquery and ASP.NET

2008-10-05 Thread MorningZ

Suggestion for .NET peoples

if you don't want MasterPages or UserControls (or any other Naming
Container for that matter to mess with your control ID's, check out
this library

http://www.wilcob.com/Demos/IDOverride/

Also, to easily work with JSON, this library is most excellent

http://james.newtonking.com/pages/json-net.aspx

And lastly, Rick Strahl's blog is an excellent one to follow in jQuery/
ASP.NET land

http://www.west-wind.com/weblog/



On Oct 5, 8:51 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 Sure. Check our corporate page : spina.com.tr. It's built on .net 3.5
  jQuery 1.2.6

 (See html source code to understand how we use it.)

 On Oct 5, 9:45 pm, eduardo [EMAIL PROTECTED] wrote:

  Is possible use JQuery in aspx pages writing with ASp.net 3.5 ?

  Thanks in advance

  Eduardo


[jQuery] Re: Jquery and ASP.NET

2008-10-05 Thread MorningZ

Personally, I don't prefer overriding
control ID's as they have to be unique

Well, yeah, that would go without saying...   even the novice
programmer should have the skill to know when to use it and when not
to...


The only downside is that you can not put your scripts in an external
(js) file

I wouldn't understate how much of a big deal that can be  as you
automatically lose browser caching of the javascript with it being on
the aspx page


Whatever though, to each their own, there's many ways to use jQuery
around .NET's respective quirks and methodology




On Oct 5, 11:12 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 MorningZ, thanks for the ideas. Personally, I don't prefer overriding
 control ID's as they have to be unique. You can easily break your code
 if you don't pay enough attention.  For .NET guys, I recommend using 
 %=ControlName.ClientID% syntax.

 The only downside is that you can not put your scripts in an external
 (js) file. You have to put them to the parent page where your aspnet
 code is.

 On Oct 6, 5:49 am, MorningZ [EMAIL PROTECTED] wrote:

  Suggestion for .NET peoples

  if you don't want MasterPages or UserControls (or any other Naming
  Container for that matter to mess with your control ID's, check out
  this library

 http://www.wilcob.com/Demos/IDOverride/

  Also, to easily work with JSON, this library is most excellent

 http://james.newtonking.com/pages/json-net.aspx

  And lastly, Rick Strahl's blog is an excellent one to follow in jQuery/
  ASP.NET land

 http://www.west-wind.com/weblog/

  On Oct 5, 8:51 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
  wrote:

   Sure. Check our corporate page : spina.com.tr. It's built on .net 3.5
jQuery 1.2.6

   (See html source code to understand how we use it.)

   On Oct 5, 9:45 pm, eduardo [EMAIL PROTECTED] wrote:

Is possible use JQuery in aspx pages writing with ASp.net 3.5 ?

Thanks in advance

Eduardo


[jQuery] jqDnR: Full Directional Support and Size Limitations

2008-10-05 Thread Andrew

Hi Everyone,

I came across jqDnR (Minimalistic Drag'n'Resize for jQuery) just the
other day, but found it only included a SE resize option and no
limitations on size. So I decided to add this support myself.

Included in this post is the min version (1.48kB), and the expanded/
dev version (2.32kB).

You can find the original version plus some basic usage examples on
the Official jqDnR page (http://dev.iceburg.net/jquery/jqDnR/).

Please disregard the resize examples on that page if you decide to use
the version in this post.

==Resizing examples==
// Assign '.handle' to resize '#box' in the 'se' direction
$('#box').jqResize('.handle','se');

// Assign '.handle' to resize '#box' in the 'w' direction
$('#box').jqResize('.handle','w');

// Assign '.handle' to resize '#box' in the 'nw' direction with a
minimum width of '100' and a minimum height of '200'
$('#box').jqResize('.handle','nw',100,200);


==Notes==
-You may create as many handles and directions as you need.
-The direction must be included.
-Possible directions: (n, ne, e, se, s, sw, w, nw)


==Download==
Please be aware that I am not the original developer of jqDnR and this
is not an official release. The original author is Brice Burgess
(http://www.iceburg.net) and deserves full credit for jqDnR in its
entirety.

Full/Developer Version (2.32kB)
http://a.hughes.googlepages.com/jquery.jqdnr.full.js
Minimized Version (1.48kB)
http://a.hughes.googlepages.com/jquery.jqdnr.js


[jQuery] Partial load strips out script tags?

2008-10-05 Thread ctford


When I use .load() to pull in a whole page, script tags are correctly pulled
in and executed. However, if I add a selector to the .load() call all script
tags get stripped out. In the following example, the heading from the second
HTML file gets pulled in, but the JS with the alert does not. Could this be
a bug?

html
head
titleAjax/title
script type=text/javascript 
src=jquery-1.2.6.min.js/script
/head

body
div id=load_target/div
script type=text/javascript
$(#load_target).load(has_script.htm #script);
/script
/body
/html

html
head
titleScript/title
/head

body
div id=script 
h1Heading/h1
script type=text/javascript
alert('Hi');
/script
/div
/body
/html
-- 
View this message in context: 
http://www.nabble.com/Partial-load-strips-out-script-tags--tp19830989s27240p19830989.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Question about jqModal

2008-10-05 Thread Brice Burgess


Igor Spasic wrote:

Hellooo -

Excellent plugin! Gem.

would you be so kind to let me know what is the best practice for
following situation:

I have a part of page that is loaded using ajax. Page contains lot of links.
Each link needs to become a trigger for specific dialog.

I do have onPageLoad() call back that is invoked when all ajax content
is loaded. For now, I put there the standard init code:
---
$('#ex2').jqm({
trigger:$('a.popupTrigger', repager.content),

});
---

Is this the best possible solution? I wonder if jqModal maybe caches
triggers between reloading pages? #ex2 is some dialog div loaded with
the ajax content.

Thank you in advance!


/Igor
  


Igor,

 Your method could work, although existing triggers are being 
re-initialized. You may want to do something like the following UPON 
AJAX LOAD;


 $('#ajaxLoadedContent a.trigger').click(function(){
$('#ex2').jqmShow();
 });

 where ajax loaded content looks like;

div id=ajaxLoadedContent
 a class=triggeropen dialog/a
 a class=triggeropen the same dialog/a
 ...
/div

Hope this helps,

~ Brice

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail? 



[jQuery] Re: jqDnR: Full Directional Support and Size Limitations

2008-10-05 Thread Brice Burgess

Andrew,

  Thanks for taking the initiative to add this support to jqDnR. I am
sure many in the community will find your revisions VERY USEFUL.

  I'll be sure to include your changes in the next release (which will
be out as soon as I have some time to revise the plugin page).

  Great work!

~ Brice


[jQuery] Re: Problem jQuery Selecting Input field

2008-10-05 Thread Faisal Basra

Yes, right Morningz looks like this.

form id=phone
   input id=phone:home /
   input id=phone:mobile /
/form

form id=customer
   input id=customer:name /
   input id=customer:city /
/form

form id=address
   input id=address:street /
   input id=address:zip /
/form

i want to access input fields, just only specifying home, mobile,name,
city, street,zip  not as form:input
please any way ?


[jQuery] Re: Ajax/load help with external javascripts

2008-10-05 Thread ricardobeat

uuh lengthy function. I came up with this for my personal library,
works in FF/IE6,7/Safari:

function runScripts(el){
var scripts = el.getElementsByTagName('script');
if (scripts) {for (var i=0;iscripts.length;i++) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.text = scripts[i].text;

document.getElementsByTagName(head)[0].appendChild(script);
}};
}

the 'language' attribute is deprecated in XHTML.

cheers
- ricardo

Rene Veerman wrote:
 Yep, you'll have to add the javascript nodes in the HTML you're
 inserting into the DIV manually.

 WTF, i'll be a nice guy and post my routines for it. you'll have to
 adapt them yourself ;)

 function parseJavascript (htmlElement) {
 var scripts = $('SCRIPT', htmlElement);
var htmlHead = $('HEAD')[0];
 for (var i=0; iscripts.length; i++) {
 var script = scripts[i];

 if (script.src) {
 var scriptsInHead = $('SCRIPT', htmlHead);
 var found = false;
 for (var j=0; jscriptsInHead.length  (!found); j++) {
 if (scriptsInHead[j].src == script.src) found = j;
 }
 var e = document.createElement(script);
 e.type=text/javascript;
 e.language='JavaScript';
 e.src = script.src;
 if (found===false) {
 console.log (mb.desktop.parseJavascript: appending
 +e.src+ to HEAD.);
 htmlHead.appendChild(e);
 } else {
 console.log (mb.desktop.parseJavascript: removing
 then re-adding +e.src+ to HEAD.);
 scriptsInHead[found].parentNode.removeChild
 (scriptsInHead[found]);
 htmlHead.appendChild (e);
 }
 } else {
 var s = scripts[i].innerHTML;
 s = s.replace (/!--/, '');
 s = s.replace (/--/, '');
 s = s.replace (/\s\s/g, '');
  //console.log (s);
 eval(s);
 }
 }




 Steve wrote:
  Hi, I'm a jQuery newbie. Basically, I'm trying to load an html file
  into a div when a button is clicked. The html file contains
  external .js and .css files for the Greybox widget. I can't get
  Greybox working, do I have to do something special to load the js and
  css before the load method? Appreciate any help.
 
  --- test.html -
 
   $(document).ready(function(){
 $(#btn).click(function(){
 
   $(#demo).load(greybox.html);
 });
   });
 
  --- greybox.html -
 
  script type=text/javascript
  var GB_ROOT_DIR = greybox/;
  /script
 
  script type=text/javascript src=greybox/AJS.js/script
  script type=text/javascript src=greybox/gb_scripts.js/script
  link href=greybox/gb_styles.css rel=stylesheet type=text/css /
 
  a href=http://google.com/; title=Google rel=gb_page_fs[]Launch
  google.com in fullscreen window/a