[jQuery] Multiple Custom Handles using Jquery UI Slider

2009-06-18 Thread zayl...@googlemail.com

Hey there,

I was wondering if any of you guys could help me out. I'm using the
Slider for Jquery UI and am having some difficulty setting a custom
style for more than one handle.


$(function() {
$("#slider").slider({ values: [2, 15] }).addClass("handle");
});


the css

.handle .ui-slider-handle{width:30px; height:30px; background:url(../
_images/deactivate_off.jpg) no-repeat; overflow: hidden; position:
absolute; top: -10px; }

and just

 for the HTML

This works for setting each handle to the style i specified above.

However I was wondering if it was possible to apply a different style
to each handle within the slider. I tried using .each and applying a
new style after the slider has been made but I couldn't get that to
work. Is there a simple solution for this?

Cheers

Zay


[jQuery] Re: jQuery 1.3.2 breaks tablesorter zebra, here's a fix

2009-03-23 Thread zayl...@googlemail.com

Thanks for this although this looked slightly different on mine and
never had the .each loop

$("tr:visible",table.tBodies[0])
.filter(':even')
.removeClass(table.config.widgetZebra.css[1]).addClass
(table.config.widgetZebra.css[0])
.end().filter(':odd')
.removeClass(table.config.widgetZebra.css[0]).addClass
(table.config.widgetZebra.css[1]);
if(table.config.debug) { 
$.tablesorter.benchmark("Applying Zebra
widget", time); }


I changed it too:

var tbodyfix = $("tr", table.tBodies[0]);
if ($(tbodyfix).css("display") !== "none" && $(tbodyfix).css
("visibility") !== "hidden") {
$(tbodyfix)
  .filter(':even')
  .removeClass(table.config.widgetZebra.css[1]).addClass
(table.config.widgetZebra.css[0])
  .end().filter(':odd')
  .removeClass(table.config.widgetZebra.css[0]).addClass
(table.config.widgetZebra.css[1]);
if(table.config.debug) { $.tablesorter.benchmark("Applying 
Zebra
widget", time); }
}

Seems to fix it and works fine.

On Mar 9, 3:14 pm, MorningZ  wrote:
> So the new jQuery code for the filter ":visible" breaks the
> tablesorter's built in Zebra functionality... kind of a hacky fix, but
> at least it works with a minor change
>
> at the end if the tablesorter.js file is the addWidget code for zebra,
> change
>
> $("tr:visible", table.tBodies[0]).each(function(i) {
>      // existing code inside this loop
>
> });
>
> to
>
> $("tr", table.tBodies[0]).each(function(i) {
>      if ($.css(this, "display") !== "none" && $.css(this,
> "visibility") !== "hidden") {
>              // existing code inside this loop
>      }
>
> });
>
> so pretty much took the selector code from 1.3 and used that inside of
> ":visible", not sure if that's the best fix ever, but it does make the
> widget act as it's supposed to