[jQuery] modify pagination plugin to support ability to input page

2009-03-24 Thread claudes


I need a paginator similar to pagination for tablesorter or jqGrid where a
user can input the page number they want to view. Issue is that the data is
not in a table, so I cannot use these plugins. 

Ideally I'm wondering if anyone has found a way to modify the pagination
plugin http://d-scribe.de/webtools/jquery-pagination/demo/demo_options.htm
to support this. I am able to get it to display the current page in an input
field but i cannot figure out how to get it to paginate to an inputed page
number. 

Thanks
-- 
View this message in context: 
http://www.nabble.com/modify-pagination-plugin-to-support-ability-to-input-page-tp22686978s27240p22686978.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] pixastic + jquery: anyone ever work with these two?

2009-02-26 Thread claudes


Hi, 

I stumbled upon Pixastic recently and thought it perfect for a current
project. I've implemented it on hover

function swapImages() { 
var img1 = $j("#cell1 img");

$j('.cell-wrapper .cell').hover(function(){
$j('img', this).pixastic("desaturate");
}, function(){
$j(this).children('.image').html(img1);
});

}

code works fine...but if i perform the action more than twice, i get this
error in firebug: uncaught exception: An invalid or illegal string was
specified (NS_ERROR_DOM_SYNTAX_ERR)
[Break on this error] return
img;},prepareData:function(params...unction(img,actionName,options,callback)

error is in pixastic js...anyone know what could be causing this/any tips?

thanks


-- 
View this message in context: 
http://www.nabble.com/pixastic-%2B-jquery%3A-anyone-ever-work-with-these-two--tp22232179s27240p22232179.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: jcarousellite: problem finding current position when visibility is a fraction

2009-02-25 Thread claudes


if i divide number of panels (kids.size()) by 2.75, i can get the indicator
to move from 1st to second position, but doesn't move beyond that...

// Clean up and abstract this code. @todo
function update_navigation(curr){
var kids = $(o.panel);
var kidsSize = (kids.size()/2.75);
var cloneVal = (o.circular) ? 2 : 0;
var pos = (kidsSize-cloneVal <= curr) ? (curr > 
kidsSize-cloneVal) ? 2 :
kidsSize-cloneVal : curr;
pos = (pos == 0) ? kidsSize-cloneVal : pos;

var indicatorImages =   
$(o.btnIndicator);
var sectionLinks = $("#sectionlinks a");

for(k = 0; k < indicatorImages.size(); k++){
if(pos == k+1){

$(indicatorImages[k]).attr("class", 'on');
} else {

$(indicatorImages[k]).attr("class", 'off');
}
}

for(k = 0; k < sectionLinks.size(); k++){
if(pos == k+1){

$(sectionLinks[k]).attr("class", 'selected');
} else {

$(sectionLinks[k]).attr("class", 'off');
}
}
};



-- 
View this message in context: 
http://www.nabble.com/jcarousellite%3A-problem-finding-current-position-when-visibility-is-a-fraction-tp22218028s27240p22218085.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] jcarousellite: problem finding current position when visibility is a fraction

2009-02-25 Thread claudes


i'm modified jcarousellite to have indicators that are updated based on
position of the element. it works as desired when i set visibility to 1 but
when i use fractions (2.75) it perform the function correctly. 

can anyone help point me to the problem with my code? thanks

this is the function to update indicators:
function update_navigation(curr){
var kids = $(o.panel);
var cloneVal = (o.circular) ? 2 : 0;
var pos = (kids.size()-cloneVal <= curr) ? 
(curr > kids.size()-cloneVal)
? 2 : kids.size()-cloneVal : curr;
pos = (pos == 0) ? kids.size()-cloneVal : pos;

var indicatorImages =   
$(o.btnIndicator);
var sectionLinks = $("#sectionlinks a");

for(k = 0; k < indicatorImages.size(); k++){
if(pos == k+1){

$(indicatorImages[k]).attr("class", 'on');
} else {

$(indicatorImages[k]).attr("class", 'off');
}
}

for(k = 0; k < sectionLinks.size(); k++){
if(pos == k+1){

$(sectionLinks[k]).attr("class", 'selected');
} else {

$(sectionLinks[k]).attr("class", 'off');
}
}
};


this is the full js file:
(function($) { // Compliant with jquery.noConflict()
$.fn.jCarouselLite = function(o) {
o = $.extend({
btnPrev: null,
btnNext: null,
btnRegExp: null,
btnNavTarget: null,
btnGo: null,
btnIndicator: "ul.nav-carousel 
li",
mouseWheel: false,
auto: true,
pauseOnHover: true,

disableClass: "disabled",
speed: 3000,
easing: null,

vertical: false,
circular: true,
visible: 2.75,
start: 0,
scroll: 1,
autoTimer: true,
rows: 1, //ADDED: Property to allow multiple rows

beforeStart: null,
afterEnd: null,

carousel: "div.content-body 
div.carousel",
panel: "div.cell-wrapper",
labels: false,

createNav: false,
btnNavContainer: '',
btnNavTarget: 'ul.nav-carousel',
btnPrevHtml: ' 
# previous ',
btnNextHtml: ' 
# next '

}, o || {});


return this.each(function() { // Returns the element collection.
Chainable.

var running = false, animCss = o.vertical ? "top" : "left",
sizeCss = o.vertical ? "height" : "width";
var div = $(this), ol = $(o.carousel), tLi = $(o.panel,
o.carousel), tl = tLi.size(), v = o.visible;
var rowCss = o.vertical ? "width" : "height"; //ADDED: rowCss is
used to set the height/width of the viewport based on how many rows are
showing
var isMouseOver = false;

// added: only perform if li > 1
if(o.circular && tl > 1) { 

ol.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());
o.start += v;
}

if(o.createNav){
create_navigation();
}
update_navigation(1);

var li = $(o.panel, o.carousel), itemLength = li.size(), curr =
o.start;
div.css("visibility", "visible");

if(tl > 1){
hideAndShowFlashContent(li, 1);
}

li.css({ overflow: "hidden", float: o.vertical ? "none" : "left"
});
ol.css({ margin: "0", padding: "0", position: "relative",
"list-style-type": "none", "z-index": "1" });
div.css({ overfl

[jQuery] validation plugin: validate checkboxes that don't have same name?

2009-02-05 Thread claudes


using validation plugin, is there a way to validate checkbox group that has
different name attributes? i would like to make sure that at least one
checkbox has been selected but i'm not sure how to do it because they all
have different names. 

thanks
-- 
View this message in context: 
http://www.nabble.com/validation-plugin%3A-validate-checkboxes-that-don%27t-have-same-name--tp21865439s27240p21865439.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] validation plugin: how to add custom messages for groups

2009-01-05 Thread claudes


i have a group that contains both first and last name. i'm wondering if it is
possible to have custom messages for groups. i'm trying to achieve something
to the following:

a. if both first and last name are not filled in: First and Last name are
Required
b. if only first is filled in: last name is required
c. if only last is filled in: first name is required

is this possible? 
-- 
View this message in context: 
http://www.nabble.com/validation-plugin%3A-how-to-add-custom-messages-for-groups-tp21299100s27240p21299100.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] new york city js & jquery tutor wanted for few months (paid)

2009-01-05 Thread claudes


I'm a front-end web developer specializing in css/html. I would like to boost
my js knowledge asap. I'm looking for an advanced js/jquery person (who is
also adamant! about web standards and accessibility) in New York City metro
area  that is willing to tutor me for a couple hours on a weekly or biweekly
basis for some months to start. 

I have some stuff that I'm developing and will also need some general js
reviews as my knowledge is sort of piecemeal.

I have been working in web for the last 5/6 years, so I'm no novice to the
medium...javascript, however, has always sort of been a bit difficult for me
to learn/master. 

Paid gig; will work out terms. I'm hoping that this can be a fun couple
hours for us both. Please reply to author if you are interested and/or for
more information.

Thanks.

ps. hope it is okay to post this here...figured i had a better shot here
than craigslist
-- 
View this message in context: 
http://www.nabble.com/new-york-city-js---jquery-tutor-wanted-for-few-months-%28paid%29-tp21297101s27240p21297101.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] how to validate multipart form?

2009-01-05 Thread claudes


i'm using jcarousel lite plugin to house a multi part form. i generate the
next and back buttons dynamically with this code:


function create_navigation(){
if ($(ol).size() > 0) {
// build links
$(ol).each(function(i){ 
if($(this).children().size() > 
1) {

$(this).parent().append(o.btnNavContainer); 
var carouselNavDiv = 
$(this).parent().children(o.btnNavTarget); 

$(carouselNavDiv).append(o.btnPrevHtml); 

$(this).children().each(function(j){
panelNum = j;
linkNum = j+1;  
/*  
$(carouselNavDiv).append(' # '+linkNum+'
');   
*/   
}); 

$(carouselNavDiv).append(o.btnNextHtml); 
}
});
}
}



i want to validate each step of the form on click of next. i know that i
need to interrupt the default click functionality and then once the step is
valid, return function(go)just not sure how to do it in the context that
i have 
if(o.btnNext){
$(o.btnNext).mouseover(function(){ isMouseOver 
= true; });
$(o.btnNext).mouseout(function(){ isMouseOver = 
false; });

$(o.btnNext).livequery("click",function() {
return go(curr+o.scroll);

});
}

i tried to follow the demo and incorporate into the code that i already have
but i can't seem to get it...i'm still learning my way through the language.
i am using jquery validation plugin. 

thanks

-- 
View this message in context: 
http://www.nabble.com/how-to-validate-multipart-form--tp21296516s27240p21296516.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] use beforeStart callback to trigger validation of current carousel slide (jcarousel lite plugin)

2009-01-03 Thread claudes


i'm using jcarousel lite to create a multi-part form and i want to validate
each section and not allow user carousel to scroll to next slide until that
part of the form is valid. 

is is possible to do this using the beforeStart callback to run validation? 

or is it possible to call validation here in this function that runs the
scroll on click of next?
$(o.btnNext).livequery("click",function() {
return go(curr+o.scroll);

});

i'm using jörn's validation plugin-in. 
-- 
View this message in context: 
http://www.nabble.com/use-beforeStart-callback-to-trigger-validation-of-current-carousel-slide-%28jcarousel-lite-plugin%29-tp21273308s27240p21273308.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] specify a content class in accordion plugin

2009-01-03 Thread claudes


is it possible to specify a class for the content container in the accordion
plugin? it is possible to for header. 

thanks
-- 
View this message in context: 
http://www.nabble.com/specify-a-content-class-in-accordion-plugin-tp21273212s27240p21273212.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] jcarousel lite each li have own height

2009-01-01 Thread claudes


currently the plugin is set-up so that it calculates the height
(offsetHeight) of the first li element and sets it as default height for the
ol/ul and other li elements in carousel. 

each of my li is variable height and when i run the plugin it cuts of
content. i'm wondering if anyone has a fix for the this issue. i would like
each li to have height: auto, or to calculate the height of each li
separately. 

my js skills are not ninja but I believe that i've identified the code in
question:
function css(el, prop) {
return parseInt($.css(el[0], prop))  // 0;
};

function height(el) {
return el[0].offsetHeight + css(el, 'marginTop') + css(el, 
'marginBottom');
};

 li.css({ width: li.width(), height: li.height() });

thanks in advance
-- 
View this message in context: 
http://www.nabble.com/jcarousel-lite-each-li-have-own-height-tp21245542s27240p21245542.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] jcarousel lite each li have own height

2009-01-01 Thread claudes


currently the plugin is set-up so that it calculates the height
(offsetHeight) of the first li element and sets it as default height for the
ol/ul and other li elements in carousel. 

each of my li is variable height and when i run the plugin it cuts of
content. i'm wondering if anyone has a fix for the this issue. i would like
each li to have height: auto, or to calculate the height of each li
separately. 

my js skills are not ninja but I believe that i've identified the code in
question:
function css(el, prop) {
return parseInt($.css(el[0], prop))  // 0;
};

function height(el) {
return el[0].offsetHeight + css(el, 'marginTop') + css(el, 
'marginBottom');
};

 li.css({ width: li.width(), height: li.height() });

thanks in advance
-- 
View this message in context: 
http://www.nabble.com/jcarousel-lite-each-li-have-own-height-tp21245540s27240p21245540.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] jcluetip problems with multiple on a page (when local = true)

2008-12-04 Thread claudes


I'm using jcluetip--multiple instances on a page--and i'm using rel to
specify that it pull the data from a class. the markup and the class is the
same for all elements. i didn't notice initially but the plugin pulls the
data from the first class instance only and uses it for all of the tooltips. 

i believe this is the code line that is causing issues: 

else if (opts.local){
var $localContent = $(tipAttribute + ':first'); // if i remove +
':first' it pulls all of data for every instance of the class and replicates
it for all of the tooltips
var localCluetip = $.fn.wrapInner ?
$localContent.wrapInner('').children().clone(true) :
$localContent.html();
$.fn.wrapInner ? $cluetipInner.empty().append(localCluetip) :
$cluetipInner.html(localCluetip);
cluetipShow(pY);


any help on how to rework the code so that each tooltip pulls from its class
instance?

thanks. 
-- 
View this message in context: 
http://www.nabble.com/jcluetip-problems-with-multiple-on-a-page-%28when-local-%3D-true%29-tp20834233s27240p20834233.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] populate selectbox with json feed...partially working, need help to finish.

2008-11-23 Thread claudes


i have this json feed:
{
"channel": {
"title": "History",
"id": "12",
"subtopics": [
{"title": "Roman History", "ID","13"},
{"title": "Greek History", "ID", "1"},
{"title": "French History", "ID", "1"}
] // subtopics
}
}

and i want to populate a select box to result as follows:

History>

Roman History
...



this is the code i have so far:

$.getJSON("jrss.js", function(json) {
var html = '';
response = {
 values: [],
 count: 0
 }; 
$.each(json.channel.subtopics,function(i,item) {
html += 'history'; // not sure where 
this goes 
response.values[i] = item.title;
html += '';
html += ''+item.title;+'';
html += '';

$('body').append(html);
});

});

var jJSON = {
getValues: function(obj,num) {
return jJSON[obj]["values"];
}
}


I can currently get the code to populate the  correctly. I still
cannot get it to assign id as the value. and i cannot dynamically assign the
history dynamically...it returns undefined.

can anyone help me with these two issues? thanks
-- 
View this message in context: 
http://www.nabble.com/populate-selectbox-with-json-feed...partially-working%2C-need-help-to-finish.-tp20654600s27240p20654600.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] urgent please help; if statement not executing

2008-11-07 Thread claudes


i'm sorry to double post but i'm at my wits end with this. i once had this
code: 

if ($('li.panel:not(:only-child)')) {
var $this =
$('li.panel:not(:only-child)').parent().parent();
($this).append('');
// build links
$('.carousel ol').each(function(i){  
var carouselNavDivs = $('ul.nav-carousel');
   
$(carouselNavDivs[i]).append('previous');
$(this).children().each(function(j){
var linkNum = 0;
linkNum = j+1;
   
$(carouselNavDivs[i]).append(''+linkNum+'');
});
   
$(carouselNavDivs[i]).append('next');
});
}

and it was executing correctly, but it caused some bizarre problems...so i
changed to: 

if ($('.carousel ol').size() > 1) {
$('.carousel').append('');

// build links  
$('.carousel ol').each(function(i){ 

var carouselNavDivs = $('ul.nav-carousel'); 

$(carouselNavDivs[i]).append(' # previous 
');  
$(this).children().each(function(j){
linkNum = j+1;

$(carouselNavDivs[i]).append(' # '+linkNum+'
');
});
$(carouselNavDivs[i]).append(' # next 
');  
});
}


but now it is adding the ul.nav-carousel to every single div.carousel and
building the links for each one instead of only doing it for div.carousel ol
that have more than one li only. 

any clue?
-- 
View this message in context: 
http://www.nabble.com/urgent-please-help--if-statement-not-executing-tp20380004s27240p20380004.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] calculating size (a problem is if statement)

2008-11-06 Thread claudes


i'm having problems with this code:

if ($('.carousel ol').children('li.panel').length > 0) {
$('.carousel ').append('');   

// build links  
$('.carousel ol').each(function(i){ 

var carouselNavDivs = $('ul.nav-carousel'); 

$(carouselNavDivs[i]).append(' # previous 
');  
$(this).children().each(function(j){
linkNum = j+1;

$(carouselNavDivs[i]).append(' # '+linkNum+'
');
});
$(carouselNavDivs[i]).append(' # next 
');  
});
}


it executes correctly, but it puts a ul.nav-carousel on each .carousel ol.
I'm looking to only append ul.nav-carousel if there is more than one li in
the .carousel ol. each li has class .panel. 

how do i make this if statement work? i had this code before but it was
causing execution problems however it correctly appended ul.nav-carousel to
ol's with more than one child only:

if ($('li.panel:not(:only-child)')) {
var $this = $('li.panel:not(:only-child)').parent().parent();
($this).append('');   

// build links  
$('.carousel ol').each(function(i){ 

var carouselNavDivs = $('ul.nav-carousel'); 

$(carouselNavDivs[i]).append(' # previous 
');  
$(this).children().each(function(j){
var linkNum = 0; 
linkNum = j+1;

$(carouselNavDivs[i]).append(' # '+linkNum+'
');
});
$(carouselNavDivs[i]).append(' # next 
');  
});
}


thanks for the help.
-- 
View this message in context: 
http://www.nabble.com/calculating-size-%28a-problem-is-if-statement%29-tp20375973s27240p20375973.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] jcarousellite: add class to btnGo/external control on click of next or previous

2008-10-29 Thread claudes


my carousel has both external control and next/prev arrows. i would like to
be able to add a class to the external control that corresponds with the
visible li. 

this is how i'm building my navigation links: 

// build links  
$('.carousel ol').each(function(i){ 

var carouselNavDivs = $('ul.nav-carousel'); 

$(carouselNavDivs[i]).append(' # previous 
');  
$(this).children().each(function(j){
var linkNum = 0; 
linkNum = j+1;

$(carouselNavDivs[i]).append(' # '+linkNum+' ');
});
$(carouselNavDivs[i]).append(' # next 
');  
});
} 

user has an option to scroll via next/prev or to click linkNum and go
directly to corresponding panel. i would still like this functionality but
would like to indicate which linkNum is currently active.

i can add class acitve onclick by modifying this bit of code in
carousellite.js:
  if (o.btnGo)
$.each(o.btnGo, function(i, val) {
$(val).click(function() {
$(this).addClass('active');
return go(o.circular ? o.visible + i : i);
});
});


but that only adds class when i click on linkNum. 

basically creating a navigation similar to pagination...i want to be able to
add a visual "this is where you are" cue either when user clicks linkNum or
when user clicks prev/next.

hope this makes sense...i was not sure how exactly i would word what i was
looking for but gave it a shot. attached an image that shows desired
results: active class would allow me to target via css and change image

http://www.nabble.com/file/p20241511/Picture%2B4.png Picture+4.png 

thanks
-- 
View this message in context: 
http://www.nabble.com/jcarousellite%3A-add-class-to-btnGo-external-control-on-click-of-next-or-previous-tp20241511s27240p20241511.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] jcarousel lite: getting it to work with a grided li display

2008-10-27 Thread claudes


i have the following designs (uploaded files better than words); using
jcarousel lite, i'm trying to achieve the gridded design and the carousel
motion (left/right)

i tried modifying the math, but it still calculates the length incorrectly
and when i number the li to make sure that 1-6, 7-12, and 13-18 are the ones
displayed, i also noted that it wasn't pulling them in that order. 

i would like to keep each li separate instead of nesting another ordered
list within the li. is there a way to achieve this without having to go with
this "hack". the max number li for the image carouse is 18, and 9 for the li
with content

my markup is:
ol
 li (each list containing the image/content) 

and this is portion of the jcarousel js that i modified:
   var liSize = o.vertical ? (height(li)*3) : (width(li));   // Full li
size(incl margin)-Used for animation
var olSize = (liSize * itemLength)/3;   // size of
full ol(total length, not just for the visible items)
var divSize = (liSize * v);   // size of
entire div(total length for just the visible items)


animCss == "left" ? { left: -(curr*(liSize/2)) } : { top: -(curr*liSize) } ,
o.speed, o.easing,



thanks

http://www.nabble.com/file/p20198422/Picture%2B2.png Picture+2.png 
http://www.nabble.com/file/p20198422/Picture%2B3.png Picture+3.png 
-- 
View this message in context: 
http://www.nabble.com/jcarousel-lite%3A-getting-it-to-work-with-a-grided-li-display-tp20198422s27240p20198422.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] superfish onclick patch--help with setup

2008-10-09 Thread claudes


can anyone provide clearer directions--a bit more step by step for us
quizzical new ones--as to how to get the onclick patch running and working
for superfish plugin?

thanks. 

c.s
-- 
View this message in context: 
http://www.nabble.com/superfish-onclick-patch--help-with-setup-tp19893657s27240p19893657.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: add/remove and recalculate index

2008-09-30 Thread claudes


variable html is this php file:

Chapter $x Remove Chapter


Chapter Title:



Chapter Web Description:



Chapter Full Description:



Thumbnail URL:  (Anamorphic ratio 2.35:1
) / Thumbnail 142px x 60px



Chapter Start Time:  H:M:S.SSS



Chapter End Time:  H:M:S.SSS




EOS;

?>
 




MorningZ wrote:
> 
> 
> its tough to diagnose without knowing what your variable "html"
> returned by the $.ajax call is
> 
> but working up an example trying to simulate it, this works as
> expected  items stay in order of adding plus the  items adjust
> their indexes automatically
> 
> http://paste.pocoo.org/show/86671/
> 
> 
> 
> 
> On Sep 30, 5:37 pm, claudes <[EMAIL PROTECTED]> wrote:
>> i have an interface that allows user to add chapters and remove any
>> chapter
>> from within the group. i'm having issues re-calculating the sort order.
>> currently if user adds four chapters (1,2,3,4), removes 2 and adds two
>> more
>> the order becomes (1, 3,4,2,3). i know i need to so something with index
>> calculation...but how to is what is confusing me. this is the code that
>> performs the add remove.
>>
>> $("#chapter-append").click(function() {
>>                         var chapterCount = new
>> Number($("#chapter-count").val());
>>                                 if (chapterCount <1) chapterCount=0;
>>                 chapterCount = chapterCount +1;
>>                  $("#chapter-count").val(chapterCount);
>>
>>                 var queryString =
>> "add-chapter.php?chapter-number="+chapterCount;
>>                 //alert(queryString);
>>          $.get(queryString, function(html) {
>>              // append the "ajax'd" data to the table body
>>              $("ol#add-chapter").append(html);
>>                                                 $("ol#add-chapter li
>> h4").bind('click', function() {
>>                                                                 var
>> newChapter = "#chapter-"+chapterCount+"-container";
>>                                                        
>> $(newChapter).remove();
>>                                                                        
>> chapterCount = chapterCount -1;
>>                                                                        
>> $("#chapter-count").val(chapterCount);
>>                                                                        
>> return false;
>>                                                 });
>>                                                 $('textarea').autogrow({
>> minHeight: 144, lineHeight: 16});      
>>                                                
>> $('textarea.for-url').autogrow({ minHeight: 24, lineHeight: 16});
>>                                 });
>>         return false;
>>         });
>>
>> --
>> View this message in
>> context:http://www.nabble.com/add-remove-and-recalculate-index-tp19750882s272...
>> Sent from the jQuery General Discussion mailing list archive at
>> Nabble.com.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/add-remove-and-recalculate-index-tp19750882s27240p19753117.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] add/remove and recalculate index

2008-09-30 Thread claudes


i have an interface that allows user to add chapters and remove any chapter
from within the group. i'm having issues re-calculating the sort order.
currently if user adds four chapters (1,2,3,4), removes 2 and adds two more
the order becomes (1, 3,4,2,3). i know i need to so something with index
calculation...but how to is what is confusing me. this is the code that
performs the add remove. 


$("#chapter-append").click(function() { 
var chapterCount = new 
Number($("#chapter-count").val());
if (chapterCount <1) chapterCount=0;
chapterCount = chapterCount +1;
 $("#chapter-count").val(chapterCount);

var queryString = 
"add-chapter.php?chapter-number="+chapterCount;
//alert(queryString);
 $.get(queryString, function(html) { 
 // append the "ajax'd" data to the table body 
 $("ol#add-chapter").append(html); 
$("ol#add-chapter li 
h4").bind('click', function() { 
var newChapter 
= "#chapter-"+chapterCount+"-container";
$(newChapter).remove(); 

chapterCount = chapterCount -1;

$("#chapter-count").val(chapterCount);
return 
false;
});
$('textarea').autogrow({ 
minHeight: 144, lineHeight: 16});  

$('textarea.for-url').autogrow({ minHeight: 24, lineHeight: 16});
}); 
return false; 
});

-- 
View this message in context: 
http://www.nabble.com/add-remove-and-recalculate-index-tp19750882s27240p19750882.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: jqmodal set trigger to radio button ?

2008-09-28 Thread claudes


worked swimmingly. thanks for new lesson; .change() --- i'll have to read up
more on it.




MorningZ wrote:
> 
> 
> SUPER quick and bare bones working example
> 
> http://pastebin.com/m6bb59575
> 
> 
> On Sep 28, 2:26 pm, claudes <[EMAIL PROTECTED]> wrote:
>> How do I set jqmodal to trigger when a radio button is selected?
>>
>> I've been trying something like this and the result is that the checkbox
>> has
>> to be checked and then clicked in order to get launch
>>
>>         function launchChecked() {
>>     $("#ex2").jqmAddTrigger(":checkbox");
>>     }
>>     launchChecked();
>>     $(":checked").click(launchChecked);
>>
>> I would prefer radio button, but checkbox is fine as well.
>>
>> --
>> View this message in
>> context:http://www.nabble.com/jqmodal-set-trigger-to-radio-button---tp1971317...
>> Sent from the jQuery General Discussion mailing list archive at
>> Nabble.com.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/jqmodal-set-trigger-to-radio-button---tp19713178s27240p19715300.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] jqmodal set trigger to radio button ?

2008-09-28 Thread claudes


How do I set jqmodal to trigger when a radio button is selected? 

I've been trying something like this and the result is that the checkbox has
to be checked and then clicked in order to get launch

function launchChecked() {
$("#ex2").jqmAddTrigger(":checkbox");
}
launchChecked();
$(":checked").click(launchChecked);


I would prefer radio button, but checkbox is fine as well. 

-- 
View this message in context: 
http://www.nabble.com/jqmodal-set-trigger-to-radio-button---tp19713178s27240p19713178.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] add/remove with ordered information

2008-09-27 Thread claudes


i have built a simple add/remove chapter form. when "add new chapter"
clicked; ajax get fired, retrieves php file, and appends new chapter. newly
appended chapter is a  added to ol#append-chapter. the script also keeps
track of chapter count and displays current chapter count in h4. 

issues:
1. when i remove a chapter, it does not recalculate the number of chapters
on the page. say i click add chapter 4 times (1, 2, 3, 4), if i remove
chapter two, my list reorders to (1,3,4) and if i click add new chapter it
displays (1, 3,4,2). to make it worse, if i add two more chapters the new
order becomes (1,3,4,2,3,4)
  - i would like the chapters to display correct order/count when added or
removed. using example above...if i remove chapter 2 i would get (1,2,3),
and adding new chapters would proceed sequentially.

2. i'm adding the remove chapter to ; each time i add a new chapter the
script executes and appends another remove chapter to every h4, even if it
already has one. 

ex. if i have two chapters:
 - chapter 1 remove chapter remove chapter
 - chapter 2 remove chapter


other than these issues, script works fine. any help tacking these final
bugs would be great. thanks!


set-up:


  Click to add chapter 


("#chapter-append").click(function() { 
var chapterCount = new 
Number($("#chapter-count").val());
if (chapterCount <1) chapterCount=0;
chapterCount = chapterCount +1;
 $("#chapter-count").val(chapterCount);

var queryString = 
"add-chapter.php?chapter-number="+chapterCount;
//alert(queryString);
 $.get(queryString, function(html) { 
 // append the "ajax'd" data to the table body 
 $("ol#add-chapter").append(html); 
$("ol#add-chapter li 
h4").append(removeChapter).bind('click',
function() { 
var newChapter 
= "#chapter-"+chapterCount+"-container";
$(newChapter).remove(); 

chapterCount = chapterCount -1;

$("#chapter-count").val(chapterCount);
return 
false;
});
}); 
return false; 
});

var removeChapter = 'Remove chapter';

this is the piece added via ajax:
Chapter $x


Chapter Title:



Chapter Web Description:



Chapter Full Description:



Thumbnail URL: Dimensions



Chapter Start Time: Time format



Chapter End Time: Time format




EOS;

?>
-- 
View this message in context: 
http://www.nabble.com/add-remove-with-ordered-information-tp19708456s27240p19708456.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] re[jQuery] place input value with user entered text

2008-09-26 Thread claudes


i have this set up:



users enter number in text field. .blur() I need to pass the entered value
to the value attribute. I'm able to get the value of the number entered in
the text box but I cannot seem to pass it to the value attribute of the
input

$('input').blur(function (){ 
var program = $(this).val();


any help in the correct direction would be great. 

thanks
-- 
View this message in context: 
http://www.nabble.com/replace-input-value-with-user-entered-text-tp19694518s27240p19694518.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: get html of check box

2008-09-25 Thread claudes


perfect. got it to integrate swimmingly. thanks

c.s


MorningZ wrote:
> 
> 
> Here's some quick and dirty (and working) code
> 
> http://paste.pocoo.org/show/86213/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/get-html-of-check-box-tp19675962s27240p19677870.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: get html of check box

2008-09-25 Thread claudes


actually what i'm after is the label "hello"

so if the checkbox is checked, i'd like to alert the label, which is hello



tlphipps wrote:
> 
> 
> I'm guessing what you're after is just getting the value of the
> checkbox.  What MorningZ said is absolutely correct.  I would suggest
> you try:
> 
> 
> 
> Then in jQuery:
> 
> $(":checkbox").click(function(){
>  alert(this.value);
> });
> 
> On Sep 25, 1:53 pm, MorningZ <[EMAIL PROTECTED]> wrote:
>> To start with, that html isn't valid, as you have
>>
>> hello
>>
>> with the checkbox  ending in "/>", which closes the tag, hence
>> the "hello" is not inside the input tag.  even if you take that
>> out, pretty sure that's not valid html anyways
> 
> 

-- 
View this message in context: 
http://www.nabble.com/get-html-of-check-box-tp19675962s27240p19676654.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: get html of check box

2008-09-25 Thread claudes


my error:

hello

it is just a basic example of what i have marked up



MorningZ wrote:
> 
> 
> To start with, that html isn't valid, as you have
> 
> hello
> 
> with the checkbox  ending in "/>", which closes the tag, hence
> the "hello" is not inside the input tag.  even if you take that
> out, pretty sure that's not valid html anyways
> 
> 

-- 
View this message in context: 
http://www.nabble.com/get-html-of-check-box-tp19675962s27240p19676125.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] pass inputed text to value attribute (using tablesorter): a simple way

2008-09-22 Thread claudes


i need to pass user entered text (which will be a number 1-10) to the value
of the . i'm using tablesorter plugin, so i need the data to be
passed automagically/immediately so that users can sort the column: Order
Stacks


any help much appreciated. thanks

here is how my code set up:







Order Stacks
I'm calling this stack mine
 / Edit 
 / Delete 






I'm calling this stack mine
 / Edit 
 / Delete 




I'm calling this stack mine
 / Edit 
 / Delete 




I'm calling this stack mine
 / Edit 
 / Delete 





I'm calling this stack mine
 / Edit 
 / Delete 





-- 
View this message in context: 
http://www.nabble.com/pass-inputed-text-to-value-attribute-%28using-tablesorter%29%3A-a-simple-way-tp19619798s27240p19619798.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] simple wizard: stuck with first jquery usage

2008-09-21 Thread claudes


Hi, 

I would like to make a simple wizard. I have gotten as far as hiding all
divs aside from the first, and inserting the next and back buttons. I'm
having problems assigning click function to next/back

next should hide current div and revel next div
back hides current and revels previous

markup (simplified): 






jquery:
$(document).ready(function() { 
// assign buttons to divs

$('#content div:not(:first)').hide();   

// hide divs
//$('div.step-two').hide();
//$('div.step-three').hide();

// insert buttons
var next = $(' #next Next ');
var back = $(' #back Back ');

$(next).insertAfter('#content div[class*=step]:not(:last) form');
$(back).insertAfter('#content div[class*=step]:gt(0) form');


//wizard functionality
$(next).click(function () {
 $('div.step-one').hide(); });
 
 
 
/*$('div.step-two a.next').click (function () {
$('div.step-two').hide();
$('div.step-three').show();
});


$('div.step-two a.back').click (function () {
$('div.step-one').show();
$('div.step-two').hide();

});

$('div.step-three a.back').click (function () {
$('div.step-two').show();
$('div.step-three').hide();

}); */
});

I've left my initial script where I was calling out each div...issue is,
number of divs is uncertain, so script needs to take that into factor and
not call out each click function as I was doing. 

Any help, any modification truly welcome. I'd like to keep it as
progressively enhanced as possible; hence hiding divs from js and inserting
next/back via DOM. 

Thanks.
-- 
View this message in context: 
http://www.nabble.com/simple-wizard%3A-stuck-with-first-jquery-usage-tp19591708s27240p19591708.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.