Bug Tracker

Opened 10 years ago

Last modified 9 years ago

#7470 closed bug

Cross-Compatibility IE 7 and 8 tested — at Initial Version

Reported by: martin@… Owned by:
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.3
Keywords: Cc:
Blocked by: Blocking:

Description

Bug Occurs in version 1.4.2 and 1.4.3

Location to test from http://appware.co.uk/live/showscreen.php?site_id=95&screentype=folder&screenid=1463

jQuery Code used to reproduce bug

For HTML and init code please use the test location

jQuery.fn.carousel = function(op){
	// merge the options over-top of the defaults
	op = $.extend({
		left_btn:'',
		right_btn:'',
		list:'',
		width:'0px',
		_elements:[],
		_current:0,
		_locked:false
	}, op);
	
	// check for left_btn if not set throw error
	if(op.left_btn == ''){
		throw "Error jQuery Carousel left_btn not defined";
	}
	
	// check that width is defined
	if(op.width == '0px'){
		throw "Error jQuery Carousel width not defined";
	}
	
	// check for right_btn if not set throw error
	if(op.right_btn == ''){
		throw "Error jQuery Carousel right_btn not defined";
	}
	
	// check for list if not set throw error
	if(op.left_btn == ''){
		throw "Error jQuery Carousel list not defined";
	}
	
	// set up left button click event
	$(op.left_btn).click(function(){
		// check for lock only run if lock is disabled
		if(op._locked == false){
			// activate lock
			op._locked = true;
			// save the currently open view
			var last = op._current;
			// set the current to the next view
			if(op._current == 0){
				op._current = op._elements.length -1;
			}else{
				op._current -= 1;
			}	
			// add the previus element to the beging
			$("#carru").prepend($(op._elements[op._current]));
			
			$(op._elements[op._current]).css({width:"0px"});
			
			// set the currently live view to shrink to the left
			$(op._elements[op._current]).animate(
				{
					width:op.width
				},
				1000,
				function(){
					$(op._elements[last]).remove();
					op._locked = false;
				}
			);
		}
	});
	
	// set up the right button click event
	$(op.right_btn).click(function(){
		// check for lock only run if lock is disabled
		if(op._locked == false){
			// activate lock
			op._locked = true;
			// save the currently open view
			var last = op._current;
			// set the current to the next view
			if(op._current == op._elements.length-1){
				op._current = 0;
			}else{
				op._current += 1;
			}
			
			// add the previus element to the beging
			$("#carru").append($(op._elements[op._current]));
			
			// set the currently live view to shrink to the left
			$(op._elements[last]).animate(
				{
					width:'0px'
				},
				1000,
				function(){
					$(op._elements[last]).remove();
					$(op._elements[last]).css({width:op.width});
					op._locked = false;
				}
			);
		}
	});
	
	// save all the li elements to a variable for access later
	$("li", op.list).each(function(){
		$(this).css({position:'relative'});
		op._elements[op._elements.length] = $(this);
	});
	
		
	// set the list to hide overflowing data
	$(op.list).css({overflow:"hidden"});
	
	// empty the list and set the new ul
	$(op.list).html("<ul id=\"carru\" style=\"width:999999px;display:block;height:inherit;padding:0;margin:0;\"></ul>");
	
	// add the first element to the live view
	$("#carru", op.list).append($(op._elements[0]));
}

Now this has been tested in Safari, Google Chrome, IE9, IE8*, IE7*, Firefox 3, Firefox 4

  • = error is created

For some reason the code is not saving as it should be and does in other browsers

Ths code is supposed to read the elements of a list, delete them and add them as needed the problem is the elemenets are not being saved into the op._elements array or read from it correctly. as it is not placing the data into the output zone correctly.

Change History (0)

Note: See TracTickets for help on using tickets.