[jQuery] Re: sortable portlets

2009-01-20 Thread besh
You can use the "handle" option of the sortable. In this case it would look like this: $(".column").sortable({ handle: '.portlet-header', connectWith: ['.column'] }); -- Bohdan Ganicky On Jan 20, 1:01 pm, shmuelzon wrote: > hey, > > i'm new to the whole jQuery scene, and i'm tr

[jQuery] Re: function text() in jquery

2009-01-12 Thread besh
Hello, maybe it could be easier to use the good old DOM in this scenario: var textNode = $('#testText').get().firstChild; // now we have the textNode var textRaw = textNode.nodeValue; // now we have the text string with all the white-space around var text = $.trim(textRaw); // we strip the trail

[jQuery] Re: Brief flash of expanded tree

2008-12-15 Thread besh
http://www.learningjquery.com/2008/10/1-awesome-way-to-avoid-the-not-so-excellent-flash-of-amazing-unstyled-content On Nov 29, 2:42 pm, Andrew wrote: > Hi > > I've got the treeview plugin set to be collapsed on load. This works > generally, but every now and then, the page loads and the tree app

[jQuery] Re: Find all tags without an tag inside

2008-09-27 Thread besh
Hi, you can try the .filter(fn) method: $('#LHNav li').filter(function() { return !$(this).children('a').length; }).bind('click', function (){...}); -- Bohdan Ganicky

[jQuery] Re: jQuery and Rails Block

2008-09-20 Thread besh
Hi Bob O, can you provide us the html sample you're working on? -- Bohdan Ganicky

[jQuery] Re: Proof of concept: Animated data grid/table jquery plugin with sorting and pagination and somewhat lightweight

2008-09-02 Thread besh
Awesome, I was just looking for such functionality recently. :) Thanks! -- Bohdan Ganicky On Sep 2, 2:09 am, num <[EMAIL PROTECTED]> wrote: > My proof of concept > > http://www.overset.com/2008/08/30/animated-sortable-datagrid-jquery-p... > > I haven't yet seen html scrolling animation like thi

[jQuery] Re: Question about variable declaration

2008-08-19 Thread besh
Hi Andrea, it's really a matter of true or false. The attr() method returns a string and so if it returns an empty one, it's evaluated as false and the part after the "||" operator is then taken. You use jQuery wrapper on both sides of the "||" operator and jQuery wrapper always returns something

[jQuery] Re: Remove an element ONLY if exists

2008-08-19 Thread besh
Karl is completely right. But if you REALLY have a reason to check for its existence you can do this: if ($('#myId').length) { $('myId').remove(); } else { alert('ooops! there's no myID to remove...'); } -- Bohdan Ganicky On Aug 18, 10:11 pm, "Gewton Jhames" <[EMAIL PROTECTED]> wrote: > The

[jQuery] Re: "not" not working (newbie)

2008-07-18 Thread besh
Hi Daniele, at the time you're attaching the click event, the paragraph has no class and thus it will accept the click event (which then works "forever"). You have to rebind all the events after the DOM has been changed. There's some interesting reading about events on Karl Swedberg's famous web

[jQuery] Re: How to make webpage to adjust to user display settings.

2008-06-03 Thread besh
Hi Aaron, it's really better to use CSS. Use percents for layout and you have exactly what you need. You can then use the max-width property to prevent spreading the page layout in an extreme resolution scenarios. There's a hack that makes it work even in the prehistoric IE6 browser: http://www.c

[jQuery] Re: How to select an element based on visibility

2008-02-23 Thread besh
Hi zephyr, try this: ... $('p.firstLine').click(function() { var $el = $(this).next(); $el.slideToggle('slow'); }); ... -- Bohdan Ganicky On Feb 23, 6:28 pm, zephyr <[EMAIL PROTECTED]> wrote: > Hi,I cannot get my finger behind this one: > > I have this HTML: > This is the first line of

[jQuery] Re: what editor do you use?

2008-02-13 Thread besh
Vim ...for everything http://www.vim.org/index.php -- Bohdan Ganicky On Feb 13, 5:38 pm, Feijó <[EMAIL PROTECTED]> wrote: > I changed my own a few weeks ago, now I'm using Editpad++ > (http://sourceforge.net/projects/notepad-plus/) > its freeware, nice resources, like macros, quick-text, high

[jQuery] Re: getting element number?

2008-02-05 Thread besh
Hi Eridius, I guess this could do it: $('#' + self.options.auto_complete_id + ' li').each(function(i) { // i is now an index $(this).bind('mouseover', function() { //do something on mouseover }); }); -- Bohdan Ganicky On Feb 5, 2:15 pm, Eridius <[EMAIL PROTECTED]> wrote: >

[jQuery] Re: Issue with next()/prev() traversal

2008-01-31 Thread besh
Oops! Mea culpa! next() and prev() gets only the very next/prev siblings. Next iteration (now tested ;)): $('#eventlist a.boldFont').nextAll('a:first').trigger('click'); $('#eventlist a.boldFont').prevAll('a:first').trigger('click&

[jQuery] Re: Issue with next()/prev() traversal

2008-01-31 Thread besh
Hi, try this: $('#eventlist a.boldFont').next('a').trigger('click'); $('#eventlist a.boldFont').prev('a').trigger('click'); -- Bohdan Ganicky On Jan 31, 4:26 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hallo, > > I am quite new to Jquery and so please forgive me if my problem sounds

[jQuery] Re: attr ie bug

2008-01-31 Thread besh
Hi vitto, are you sure that the problem isn't somewhere else? Link would be fine... Anyway, I have a tip for you. What about to make this a oneliner: $('a.ppt, a.pdf, a.allegato, a.doc, a.jpg, a.xls, a.external, a.zip').attr('target','_blank'); -- Bohdan Ganicky On Jan 31, 3:46 pm, hcvitto <[

[jQuery] Re: Performance Tuning Help

2008-01-24 Thread besh
Hi Raymond, I'm not sure if this is less cpu intensive, but at least it's more jQuery: $('div.box').each(function() { var $snippet = $(this).find('dd p').html(); $(this).append('' + $snippet + ''); }); -- Bohdan Ganicky On Jan 24, 12:01 am, Raymond <[EMAIL PROTECTED]> wrote: > I was wonder

[jQuery] Re: how to build a image cycle?

2008-01-23 Thread besh
Hi DoZ, try the neat jQuery Cycle plugin: http://www.malsup.com/jquery/cycle/ -- Bohdan Ganicky On Jan 23, 7:11 pm, DoZ <[EMAIL PROTECTED]> wrote: > Hi all! > I "simply" need to build an image rotation/cycle; it has to be > vertical, automatic, "looping", and the images have to be in tags. > >

[jQuery] Re: Adding CSS-property & therefore traveling the DOM - Problem.

2008-01-23 Thread besh
Hi again, in the previous post I put "img" to the children() method. Of course it should be "a"... -- Bohdan Ganicky On Jan 22, 11:55 pm, Jayzon <[EMAIL PROTECTED]> wrote: > Hi! > > To get this right, I'll post the html-part first: > > > > >

[jQuery] Re: Adding CSS-property & therefore traveling the DOM - Problem.

2008-01-23 Thread besh
Hi Jayzon, $(document).ready(function(){ $("a.email").hover( function () { $ (this).parent().siblings("div.memberpic").children("img").css({"margin- left":"-210px"}); }, function () { $

[jQuery] Re: jquery 1.2.2 and animate()

2008-01-21 Thread besh
Hi Stefan, try this one: http://plugins.jquery.com/project/color -- Bohdan Ganicky On Jan 21, 1:21 pm, "Stefan Kilp [sk-software]" <[EMAIL PROTECTED]> wrote: > hi, > > what is the best way to animate background-color with jquery. > > i tried > > $j(this).animate({backgroundColor:"#ff"}, 200

[jQuery] Re: How to select the last item in a collection?

2008-01-17 Thread besh
Hi Jesper, you might be interested in this: http://dev.jquery.com/ticket/2164 -- Bohdan Ganicky On Jan 17, 11:00 am, "Jesper Rønn-Jensen" <[EMAIL PROTECTED]> wrote: > I made a script that makes a div clickable by selecting all class="click"> and setting the onclick event to go to the href of a

[jQuery] Re: How to select the last item in a collection?

2008-01-17 Thread besh
Anyway, the answer is: location.href = $(this).find('p a:last')[0].href; -- Bohdan Ganicky On Jan 17, 11:00 am, "Jesper Rønn-Jensen" <[EMAIL PROTECTED]> wrote: > I made a script that makes a div clickable by selecting all class="click"> and setting the onclick event to go to the href of a > li

[jQuery] Re: Checking whether a jquery function exists

2008-01-14 Thread besh
Hi again, I guess you should try something like this: if (jQuery.isFunction(jQuery.datepicker)) { ... } -- Bohdan Ganicky On Jan 14, 3:14 pm, "Dan Eastwell" <[EMAIL PROTECTED]> wrote: > Thanks Bohdan, > > That sounds like it should work, but > > if(jQuery.isFunction(datepicker())){ >

[jQuery] Re: Inserting element into jQuery object

2008-01-13 Thread besh
Hi Josh, don't try to reinvent the wheel here. Just use the jQuery http://docs.jquery.com/Traversing/add#expr";>.add() method: var $divs = $('div#first,div#second'); ... $divs = $divs.add('div#third'); -- Bohdan Ganicky On Jan 10, 8:32 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote: > I'm havin

[jQuery] Re: Attempts failing to cause div to slide up, slide down

2008-01-13 Thread besh
Well, let's take a look on your jQuery code: $(document).ready(function() { $('div.image-wrapper').find('div.menu-details').hide() // well, this works fine, even if I don't get why you use class instead of id to locate the menu-details (you have the id="menu-details" in the markup as well)

[jQuery] Re: Inserting element into jQuery object

2008-01-13 Thread besh
Hi Josh, don't try to reinvent the wheel here. Just use the jQuery http://docs.jquery.com/Traversing/add#expr";>.add() method: var $divs = $('div#first,div#second'); ... $divs = $divs.add('div#third'); -- Bohdan Ganicky On Jan 10, 8:32 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote: > I'm havin

[jQuery] Re: Inserting element into jQuery object

2008-01-13 Thread besh
Hi Josh, don't try to reinvent the wheel here. Just use the jQuery http://docs.jquery.com/Traversing/add#expr";>.add() method. :) var $divs = $('div.first,div.second'); ... $divs = $divs.add('div.third'); -- Bohdan Ganicky On Jan 10, 8:32 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote: > I'm ha

[jQuery] Re: Chaining Effects

2007-12-30 Thread besh
I think that what you need is a callback function. Something like this: $('#old_stuff').fadeOut('slow', function() { $('#new_stuff').fadeIn('slow'); }); Now #new_stuff appears only after #old_stuff faded out. I hope it's clear enough. -- Bohdan Ganicky On Dec 30, 4:38 am, "[EMAIL PROTECTED]"

[jQuery] $.post() response dataType

2007-06-20 Thread besh
Hi, is $.post() always returning string as response data? $.post(url, { param1: value, param2: value }, function(data) { alert(typeof data); --> string } Even if the data is JSON? Do I have to use $.ajax() instead? Thanks for your help. Bohdan

[jQuery] Re: How to re-apply previous events.

2007-06-14 Thread besh
http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery#Rate_me:_Using_Ajax ...the second example. Is this what you're looking for? -- Bohdan On Jun 14, 3:42 pm, Tom Holder <[EMAIL PROTECTED]> wrote: > Hi All, > > I have some xhtml in my page with images that have certain events. A > click

[jQuery] Re: object detection in jQuery

2007-05-29 Thread besh
want. > > One of the great things about jQuery, however, is the basic concept. > If it doesn't find the element it doesn't do anything so there is no > need for conditional logic ;) > > On May 29, 12:22 pm, besh <[EMAIL PROTECTED]> wrote: > > > Hi

[jQuery] object detection in jQuery

2007-05-29 Thread besh
Hi all, before jQuery, I was used to check for existence of certain elements like this: if (!document.getElementById('myElem')) { return false; } else { doSomething(); } Is there some jQuery way of doing this, or should I use the old DOM one? Thanks! Bohdan

[jQuery] Re: Attribute selectors

2007-05-28 Thread besh
Hello Adrain, have you tried something like this? $('div').not('.myClass') This will get all divs on a page except those with class .myClass. Bohdan