I am building a jssor slider dynamically using javascript. The slider is based on the jssor 'carousel' demo. Everything looks correct when displayed, including the navigation arrows at either end of the slider. It will also respond correctly when I swipe left or right with the mouse. The slider, however, does not respond to any clicks on the nav arrows.
One problem I have seen mentioned in other postings is improper nesting of the nav arrows. I don't think that is the problem here. Any help would be most appreciated.
Here is the javascript that builds the slider:
var CpxRowSlider = function(callback) {
var callback;
var indexedImgEl = new Array();
var DEFAULT_H = 110;
var DEFAULT_W = 260;
var outerDivEl = document.createElement('div');
var title = true;
var addNavArrows = true;
var sliderDivEl = null;
var sliderId = "slider_SOLO";
/*
* image set should be an array of key-value pairs where the value is the
* URL of an image and the key will be used as a tag that identifies the
* image in any callback functions.
*/
function create(imageSet) {
/* Slides Container -- */
var rowDivEl = document.createElement('div');
$(rowDivEl).attr("u", "slides");
$(rowDivEl).css({
"cursor" : "move",
"position" : "absolute",
"left" : "0px",
"top" : "0px",
"width" : "780px",
"height" : "110px",
"overflow" : "hidden"
});
for ( var key in imageSet) {
var imgUrl = imageSet[key];
var imgDivEl = document.createElement('div');
var imgEl = document.createElement('img');
imgEl.src = imgUrl;
$(imgEl).attr("u", "image");
imgDivEl.appendChild(imgEl);
// add to row
rowDivEl.appendChild(imgDivEl);
$(imgEl).data("cpxKey", key);
/*
* actions associated with the img....
*/
/*
* click event gets handed off via callback
*/
if ((callback != undefined) && (callback != null)) {
imgEl.onclick = function(evt) {
var targetImg = evt.target;
trace("Click on " + $(targetImg).data("cpxKey"));
callback($(targetImg).data("cpxKey"));
};
}
}
// add slides to a slider...
sliderDivEl = document.createElement('div');
sliderDivEl.id = sliderId
$(sliderDivEl).css({
"position" : "relative",
"left" : "0px",
"top" : "0px",
"width" : "780px",
"height" : "110px"
});
// add to DOM
sliderDivEl.appendChild(rowDivEl);
if (addNavArrows) {
sliderDivEl.appendChild(createNavArrow(true));
sliderDivEl.appendChild(createNavArrow(false));
}
outerDivEl.appendChild(sliderDivEl);
}
function createNavArrow(toLeft) {
var arrowSpan = document.createElement('span');
$(arrowSpan).attr("u", "image");
$(arrowSpan).css({
"top" : "30px",
"width" : "55px",
"height" : "55px"
});
if (toLeft) {
$(arrowSpan).css({
"left" : "5px"
});
$(arrowSpan).addClass("jssora03l");
} else {
$(arrowSpan).css({
"right" : "5px"
});
$(arrowSpan).addClass("jssora03r");
}
return arrowSpan;
}
/*
* Invoked only AFTER the slider has been added to the DOM
*/
function finalize() {
// add to sliders being controlled by jssor
var sliderOptions = getSliderOptions();
var jssor_sliderh = new $JssorSlider$(sliderId, sliderOptions);
}
function getSliderOptions() {
var sliderhOptions = {
/*
* $AutoPlay [Optional] Whether to auto play, to enable slideshow,
* this option must be set to true, default value is false
*/
$AutoPlay : false,
/*
* $PauseOnHover [Optional] Whether to pause when mouse over if a
* slider is auto playing, 0 no pause, 1 pause for desktop, 2 pause
* for touch device, 3 pause for desktop and touch device, default
* value is 1
*/
$PauseOnHover : 1,
/*
* $AutoPlaySteps [Optional] Steps to go for each navigation request
* (this options applys only when slideshow disabled), the default
* value is 1
*/
$AutoPlaySteps : 2,
/*
* $ArrowKeyNavigation [Optional] Allows keyboard (arrow key)
* navigation or not, default value is false
*/
// $ArrowKeyNavigation : true,
/*
* [Optional] Specifies default duration (swipe) for slide in
* milliseconds, default value is 500
*/
$SlideDuration : 300,
/*
* [Optional] Minimum drag offset to trigger slide , default value
* is 20
*/
$MinDragOffsetToSlide : 20,
/*
* [Optional] Width of every slide in pixels, default value is width
* of 'slides' container
*/
$SlideWidth : DEFAULT_W,
/*
* [Optional] Height of every slide in pixels, default value is
* height of 'slides' container
*/
// $SlideHeight: 150,
/*
* [Optional] Space between each slide in pixels, default value is 0
*/
$SlideSpacing : 3,
/*
* [Optional] Number of pieces to display (the slideshow would be
* disabled if the value is set to greater than 1), the default
* value is 1
*/
$DisplayPieces : 3,
/*
* [Optional] The offset position to park slide (this options applys
* only when slideshow disabled), default value is 0.
*/
$ParkingPosition : 0,
/*
* [Optional] The way (0 parellel, 1 recursive, default value is 1)
* to search UI components (slides container, loading screen,
* navigator container, arrow navigator container, thumbnail
* navigator container etc).
*/
$UISearchMode : 0,
// ...................................
// [Optional] Options to specify and enable navigator or not
$BulletNavigatorOptions : {
$Class : $JssorBulletNavigator$, // [Required] Class to
// create navigator instance
$ChanceToShow : 1, // [Required] 0 Never, 1 Mouse Over, 2
// Always
$AutoCenter : 0, // [Optional] Auto center navigator in
// parent container, 0 None, 1 Horizontal, 2
// Vertical, 3 Both, default value is 0
$Steps : 1, // [Optional] Steps to go for each navigation
// request, default value is 1
$Lanes : 1, // [Optional] Specify lanes to arrange items,
// default value is 1
$SpacingX : 0, // [Optional] Horizontal space between each item
// in pixel, default value is 0
$SpacingY : 0, // [Optional] Vertical space between each item
// in pixel, default value is 0
$Orientation : 1
// [Optional] The orientation of the navigator, 1 horizontal, 2
// vertical, default value is 1
}
}
return sliderhOptions;
}
function trace(msg) {
console.log("CpxRowSlider: " + msg);
}
return {
create : create,
finalize : finalize,
getContainer : function() {
return outerDivEl;
}
};
};
UPDATE:
Well, some digging around turned up the "where" but the "why" is still a mystery. The generated HTML should look something like this (minus the "styles" for clarity):
<div id="slider_SOLO" >
<div u="slides">
<div>
<img u="image" src="../foo1.jpg" />
</div>
<div>
<img u="image" src="../foo2.jpg" />
</div>
<div>
<span u="arrowleft" class="jssora03l" ></span>
<span u="arrowright" class="jssora03r"></span>
</div>
The problem is that in the actual HTML page there are TWO elements with the attribute u="slides". The 2nd is the correct one but just before it is another empty div. In other words, the DOM I see when I examine the displayed HTML is more like:
<div id="slider_SOLO" >
<div u="slides"></div>
<div u="slides">
<div>
<img u="image" src="../foo1.jpg" />
</div>
<div>
<img u="image" src="../foo2.jpg" />
</div>
<div>
<span u="arrowleft" class="jssora03l" ></span>
<span u="arrowright" class="jssora03r"></span>
</div>
If I add a similar div to the jssor carousel demo HTML, I get the same behavior (i.e., navigation arrows no longer work).
The problem is that the error (i.e., the extra DIV) is not inserted by my javascript. Rather it seems to be linked to the call
var jssor_sliderh = new $JssorSlider$(sliderId, sliderOptions);
I am wondering if the cause is something in the options I pass in.
Found it! The root cause was indeed my options but not in the way I thought. I was missing the $ArrowNavigatorOptions. The mystery DIV is still being inserted but everything now works correctly.
The take-away lesson for me is that jssor seems to fail quietly in the sense that rather than generate a console message about the missing option it simply did nothing.
Related
I made one helper for open new popup window on click and I have a problem with setup default values inside object. I need to calculate position for TOP and LEFT position for popup to center new popup. Here is complete code:
/*
$(element).onPopup(options); - Open Popup window
-Ths function open new popup window on your browser
EXAMPLE:
----------------------------------------------
Google
$("a#link").onPopup({
name : "Popup Window",
width : 800,
height : 600
});
OPTIONS:
----------------------------------------------
attr // attribute where is located link
name // name of popup window
width // max width
height // max height
left // position left (px)
top // position top (px)
resizable // resizable 1 or 0
location // display location 1 or 0
fullscreen // open in full screen 1 or 0
scrollbars // display scroll bars 1 or 0
titlebar // display title bar 1 or 0
toolbar // display tool bar 1 or 0
directories // display directories 1 or 0
*/
$.fn.onPopup=function(options){
var s = {
attr : "href",
name : "Popup Window",
width : 700,
height : 600,
left : ($(window).width()/2)-(this.width/2),
top : ($(window).height()/2)-(this.height/2),
resizable : 0,
location : 0,
fullscreen : 0,
scrollbars : 1,
titlebar : 0,
toolbar : 0,
directories : 0
},
$element = this;
s = $.extend(s,options);
$element.on("click",function(e) {
e.stopPropagation(); e.preventDefault();
window.open(
$(this).attr(s.attr), s.name, "width="+s.width+", height="+s.height+", directories="+s.directories+", toolbar="+s.toolbar+", titlebar="+s.titlebar+", scrollbars="+s.scrollbars+", fullscreen="+s.fullscreen+", location="+s.location+", resizable="+s.resizable+", top="+s.top+", left="+s.left
);
});
};
And here is where is my problem:
var s = {
/*...*/
width : 700,
height : 600,
left : ($(window).width()/2)-(this.width/2),
top : ($(window).height()/2)-(this.height/2),
/*...*/
},
How to pass width/height to another object to work?
One way is to create the object first then add extra properties that reference other properties in the object
var s = {
attr : "href",
name : "Popup Window",
width : 700,
height : 600,
left : null, //calculated if not user provided
top : null //calculated if not user provided
....
};
// update user settings
s = $.extend(s,options);
// calculate based on actual values
if(s.left === null){
s.left = ($(window).width()/2)-(s.width/2);
}
if(s.top === null){
s.top = ($(window).height()/2)-(s.height/2);
}
Also note you should return this.each(.. and run your business there so you have separate instances when selector includes more than one element as well as make the plugin chainable with other jQuery methods
According to your API in the code comments you want the caller to be able to specify their own left and top positions.
You therefore need to check whether any values have been given at all, and only then calculate the default position based on the configured width and height.
var s = {
... // defaults, *not including* "left" and "top"
};
// override the defaults with the user-supplied options
// NB: no need to re-assign to `s` - `$.extend` overwrites
// the contents of the first parameter
$.extend(s, options);
// then calculate `left` and `top` if they weren't supplied
if (s.left === undefined) {
s.left = ($(window).width() - s.width) / 2;
}
if (s.top === undefined) {
s.top = ($(window).height() - s.height) / 2;
}
I'm trying to add Class to Current Slider div, I am using Jssor Slider, I've tried given JS below for add class to current slide, but it's not working. I have use this JS with Jssor Call.
// event fired when slider is "parked"
jssor_slider1.$On( $JssorSlider$.$EVT_PARK, function(slideIndex){
var allImages = $(jssor_slider1.$Elmt).find("img[u=image]");
var currentImage = allImages.eq(slideIndex);
var currentDiv = currentImage.parent("div");
currentDiv.addClass("current");
});
// event fired when slider starts moving
jssor_slider1.$On( $JssorSlider$.$EVT_POSITION_CHANGE, function(position){
// remove 'current' class from all slides
$(jssor_slider1.$Elmt).find(".current").removeClass("current");
});
Jssor Call Below:
jQuery(document).ready(function($) {
//Define an array of slideshow transition code
var _SlideshowTransitions = [
{$Duration:1200,x:1,$Delay:40,$Cols:6,$Formation:$JssorSlideshowFormations$.$FormationStraight,$Easing:{$Left:$Jease$.$InOutQuart,$Opacity:$Jease$.$Linear},$Opacity:2,$ZIndex:-10,$Brother:{$Duration:1200,x:1,$Delay:40,$Cols:6,$Formation:$JssorSlideshowFormations$.$FormationStraight,$Easing:{$Top:$Jease$.$InOutQuart,$Opacity:$Jease$.$Linear},$Opacity:2,$ZIndex:-10,$Shift:-100}},
{$Duration:1200,y:0.3,$Cols:2,$During:{$Top:[0.3,0.7]},$ChessMode:{$Column:12},$Easing:{$Top:$Jease$.$InCubic,$Opacity:$Jease$.$Linear},$Opacity:2},
{$Duration:1200,x:0.3,$Rows:2,$During:{$Left:[0.3,0.7]},$ChessMode:{$Row:3},$Easing:{$Left:$Jease$.$InCubic,$Opacity:$Jease$.$Linear},$Opacity:2}
];
var options = {
$AutoPlay: true,
$PauseOnHover: 1, //[Optional] Whether to pause when mouse over if a slideshow is auto playing, default value is false
$ArrowKeyNavigation: true, //Allows arrow key to navigate or not
$SlideWidth: 800, //[Optional] Width of every slide in pixels, the default is width of 'slides' container
//$SlideHeight: 300, //[Optional] Height of every slide in pixels, the default is width of 'slides' container
$SlideSpacing: 0, //Space between each slide in pixels
$Cols: 1, //Number of pieces to display (the slideshow would be disabled if the value is set to greater than 1), the default value is 1
//New add for random transition
$SlideshowOptions: {
$Class: $JssorSlideshowRunner$,
$Transitions: _SlideshowTransitions,
$TransitionsOrder: 0, //The way to choose transition to play slideshow, 1: Sequence, 0: Random
$ShowLink: true
},
$ArrowNavigatorOptions: { //[Optional] Options to specify and enable arrow navigator or not
$Class: $JssorArrowNavigator$, //[Requried] Class to create arrow navigator instance
$ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always
$Steps: 1 //[Optional] Steps to go for each navigation request, default value is 1
}
};
var jssor_slider1 = new $JssorSlider$("slider1_container", options);
//responsive code begin
//you can remove responsive code if you don't want the slider scales while window resizes
function ScaleSlider() {
var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth;
if (parentWidth)
jssor_slider1.$ScaleWidth(Math.min(parentWidth, 800));
else
window.setTimeout(ScaleSlider, 30);
}
ScaleSlider();
$(window).bind("load", ScaleSlider);
$(window).bind("resize", ScaleSlider);
$(window).bind("orientationchange", ScaleSlider);
//============== Find Current slide Code =====================//
// event fired when slider is "parked"
jssor_slider1.$On($JssorSlider$.$EVT_PARK, function(slideIndex) {
var allImages = $(jssor_slider1.$Elmt).find("img[u=image]");
var currentImage = allImages.eq(slideIndex);
var currentDiv = currentImage.parent("div");
currentDiv.addClass("current");
});
// event fired when slider starts moving
jssor_slider1.$On($JssorSlider$.$EVT_POSITION_CHANGE, function(position) {
// remove 'current' class from all slides
$(jssor_slider1.$Elmt).find(".current").removeClass("current");
});
//============================================================//
}); // Call end
(Demo) Please see the Fiddle >>
Current slide should be red bored color when add class to current slide, but it's not working, it's unable to find current slide (some time Find for few moment), but where is the problem?
Trying to find current Slide div and add Class properly.
More Information:
This JS was good without random transition: demo http://jsfiddle.net/y7fap5dy/8/
But when I've added random transition code, it's unable to add class to current div.
Please compare:
Without random transition demo: http://jsfiddle.net/y7fap5dy/8/
Random transition demo: http://jsfiddle.net/y7fap5dy/7/ (unable to add class to current div)
Thanks in advance.
There are 2 issues:
first: You are applying the class current to the wrong div (to the inner most), that is why at random transition sometimes only a part (the innermost image) is affected.
the image structure at jssor has a lot of nested divs, you need to go up the dom to find the correct div.
so just change your variable currentDiv to:
var currentDiv = currentImage.closest('#slider1_container').children("div");
this finds the first nested div in your jssor slider, there you want your class current added.
second: in order to find out once a slide is changing, you need to check with $EVT_STATE_CHANGE for idleBegin and idleEnd; don't use $EVT_PARK:
jssor_slider1.$On( $JssorSlider$.$EVT_STATE_CHANGE , function(slideIndex, progress, progressBegin, idleBegin, idleEnd, progressEnd){
// add 'current' class to slide
if(progress==idleBegin){
var allImages = $(jssor_slider1.$Elmt).find("img[u=image]");
var currentImage = allImages.eq(slideIndex);
var currentDiv = currentImage.closest('#slider1_container').children("div");
currentDiv.addClass("current");
}
// remove 'current' class from slide
else if(progress==idleEnd){
$(jssor_slider1.$Elmt).find(".current").removeClass("current");
}
});
check the updated fiddle
I am using equalHeightColumns.js to provide a cross browser equal height, which works fine until I need to have 2 sets of equal height.
So at the moment I have:
$(".row").each(function(){
$(this).find(".equalHeight").equalHeightColumns();
});
<div class="row">
<section class="equalHeight"></section>
<section class="equalHeight"></section>
</div>
<div class="row">
<section class="equalHeight"></section>
<section class="equalHeight"></section>
</div>
As you can see I dont want everything with the equalHeight to have the same height only inside the same row.
The problem is that now I need to change the mark up and dont have the row to reference. Is it possible to make this work like the lightbox rel='group2' plugin so that I can group the equalHeight elements via attribute.
E.g: this would be
<section class="equalHeight" rel="group1"></section>
<section class="equalHeight" rel="group1"></section>
<section class="equalHeight" rel="group2"></section>
<section class="equalHeight" rel="group2"></section>
equalHeightColumns.js
/*!
* equalHeightColumns.js 1.0
*
* Copyright 2013, Paul Sprangers http://paulsprangers.com
* Released under the WTFPL license
* http://www.wtfpl.net
*
* Date: Thu Feb 21 20:11:00 2013 +0100
*/
(function($) {
$.fn.equalHeightColumns = function(options) {
defaults = {
minWidth: -1, // Won't resize unless window is wider than this value
maxWidth: 99999, // Won't resize unless window is narrower than this value
setHeightOn: 'min-height', // The CSS attribute on which the equal height is set. Usually height or min-height
heightMethod: 'outerHeight',// Height calculation method: height, innerHeight or outerHeight
delay: false,
delayCount: 100
};
var $this = $(this); // store the object
options = $.extend({}, defaults, options); // merge options
// Recalculate the distance to the top of the element to keep it centered
var resizeHeight = function(){
// Get window width
var windowWidth = $(window).width();
// Check to see if the current browser width falls within the set minWidth and maxWidth
if(options.minWidth < windowWidth && options.maxWidth > windowWidth){
var height = 0;
var highest = 0;
// Reset heights
$this.css( options.setHeightOn, 0 );
// Figure out the highest element
$this.each( function(){
height = $(this)[options.heightMethod]();
if( height > highest ){
highest = height;
}
} );
// Set that height on the element
$this.css( options.setHeightOn, highest );
} else {
// Add check so this doesn't have to happen everytime
$this.css( options.setHeightOn, 0 );
}
};
// Call once to set initially
if (options.delay){
setTimeout(resizeHeight, options.delayCount);
} else {
resizeHeight();
}
// Call on resize. Opera debounces their resize by default.
$(window).resize(resizeHeight);
};
})(jQuery);
If you want an automatic script, you need to do a recursive function like that :
var $all = $('.equalHeight'),
arrEqualH = [];
recursiveFilter()
function recursiveFilter(){
var attr = $all.first().attr('rel');
arrEqualH.push($('[rel='+attr+']'));
$all = $all.not('[rel='+attr+']');
if($all.length) recursiveFilter()
}
$.each(arrEqualH, function(){
this.equalHeightColumns();
})
Fiddle : http://jsfiddle.net/2w9tq/
You could try that:
$(".row").each(function(){
$(this).find(".equalHeight[rel='group1']").equalHeightColumns();
$(this).find(".equalHeight[rel='group2']").equalHeightColumns();
});
I'm using Intel's AppFramework and I have this code :
<div title="welcome" id="login" class="panel" selected="true">
<!-- some code here -->
Sign Up
<!-- some code here -->
</div
<div title="register" id="register" class="panel">
<!-- some code here -->
Cancel
<!-- some code here -->
</div>
the transition from #login to #register works like a charm, page loaded from right-to-left.
but how to apply 'slide-back' transition make 'cancel' button on #register to load #login
from left-to-right?
I saw on ui/transition/all.js documentation :
Initiate a sliding transition. This is a sample to show how transitions are implemented.
These are registered in $ui.availableTransitions and take in three parameters.
#param {Object} previous panel
#param {Object} current panel
#param {Boolean} go back
#title $ui.slideTransition(previousPanel,currentPanel,goBack);
but how to add 'goBack' parameter into my code? thank you
here's the complete code of the slide transition :
(function ($ui) {
/**
* Initiate a sliding transition. This is a sample to show how transitions are implemented. These are registered in $ui.availableTransitions and take in three parameters.
* #param {Object} previous panel
* #param {Object} current panel
* #param {Boolean} go back
* #title $ui.slideTransition(previousPanel,currentPanel,goBack);
*/
function slideTransition(oldDiv, currDiv, back) {
oldDiv.style.display = "block";
currDiv.style.display = "block";
var that = this;
if (back) {
that.css3animate(oldDiv, {
x: "0%",
y: "0%",
complete: function () {
that.css3animate(oldDiv, {
x: "100%",
time: $ui.transitionTime,
complete: function () {
that.finishTransition(oldDiv, currDiv);
}
}).link(currDiv, {
x: "0%",
time: $ui.transitionTime
});
}
}).link(currDiv, {
x: "-100%",
y: "0%"
});
} else {
that.css3animate(oldDiv, {
x: "0%",
y: "0%",
complete: function () {
that.css3animate(oldDiv, {
x: "-100%",
time: $ui.transitionTime,
complete: function () {
that.finishTransition(oldDiv, currDiv);
}
}).link(currDiv, {
x: "0%",
time: $ui.transitionTime
});
}
}).link(currDiv, {
x: "100%",
y: "0%"
});
}
}
$ui.availableTransitions.slide = slideTransition;
$ui.availableTransitions['default'] = slideTransition;
})(af.ui);
There is no way to do this, because the back parameter is hardcoded on always false (zero, in fact).
I edited the appframework.ui.js, the last lines of checkAnchorClick().
Where it says:
//lookup for a clicked anchor recursively and fire UI own actions when applicable
var checkAnchorClick = function(e, theTarget) {
// ...
href = theTarget.hash.length > 0 ? theTarget.hash : href;
$.ui.loadContent(href, resetHistory, 0, mytransition, theTarget);
return;
}
};
I've added a new property to the HMTL called data-back, which will be set on true if you want a reverse slide transition. I also replace that magic zero for the goBack variable when calling $.ui.loadContent().
//lookup for a clicked anchor recursively and fire UI own actions when applicable
var checkAnchorClick = function(e, theTarget) {
// ...
href = theTarget.hash.length > 0 ? theTarget.hash : href;
var goBack = theTarget.getAttribute("data-back") === "true" ? true : false;
$.ui.loadContent(href, resetHistory, goBack, mytransition, theTarget);
return;
}
};
And remeber to add the property to your link:
<a data-back="true" href="#login" class="soc-btn gray-btn left" data-transition="slide">Cancel</a>
Is this what you are after?
The third parameter of loadContent will transition from left to right if true and right to left if false
$.ui.loadContent("#Login", false, true, "slide");
or you can use
$.ui.goBack();
to go to the previous page on the back stack
I have a site. I want to make 3 vertical divs with equal height. For this purposes I change the height of last block in each column/div.
For example, the naming of 3 columns are:
.leftCenter
.rightCenter
.right
Now I wrote a code which set the equal height for .leftCenter and .rightCenter:
var left = $('.leftCenter').height();
var center = $('.rightCenter').height();
var news = $('#newItemsList').height();
if (center < left)
$('.rightCenter').height(center + (left-center));
else if (center > left)
$('#newItemsList').height(news + (center-left));
news is the latest subblock in left column (there are 3 images in it). So, if central div is bigger than left div, I change the height of news to make them equal. This code works in Firefox, but doesn't work in Chrome. That's the first question. And the last is: how to make equal 3 divs (including right one).
I needed to make elements equal in height and width so I made the following function that allows you to define a height, or width, or really whatever at it. refType would be used if you sent a min-height and needed it to match the height of the tallest element.
elemsEqual = function (options) {
var defaults = {
'type' : 'height',
'refType' : '',
'elements' : [],
'maxLen' : 450
},
settings = $.extend({}, defaults, options),
max = 0;
$(settings.elements.join(",")).each(function () {
max = Math.max( max, parseInt( $(this).css(settings.type) ) );
if(settings.refType.length) max = Math.max( max, parseInt( $(this).css(settings.refType) ) );
});
max = ((max < settings.maxLen) ? max : settings.maxLen);
$(settings.elements.join(",")).css(settings.type, max + "px");
};
elemsEqual({elements : ['#selector1','#selector2', ... '#selectorN'], type : 'height'});
Well I have this so far:
//Get the height of the right column since it starts at a different Y position than the other two
var right=$('.right').outerHeight(1)-$('.left').children('header').outerHeight(1)-$('.left .innav').outerHeight(1);
//Get the max of the 3
var height_max=Math.max($('.leftCenter').outerHeight(1),$('.rightCenter').outerHeight(), right);
//Apply the max to all 3
$('.rightCenter').height(height_max-3); //-3 to accommodate for padding/margin
$('.right').height(height_max);
$('.leftCenter').height(height_max);
The only problem is that it does not make #newItemsList as tall as the parent, .leftCenter. It also assumes that the right div will be largest, so I don't know if it will still work if it isn't the biggest of the 3.