-
AuthorPosts
-
May 3, 2011 at 4:33 am #163517
Hi, i have problem using ja content slider 2 with mootools 1.2.5. when i use mootools 1.2.5 content in ja contnet slider 2 didn’t show. I need mootools 1.2.5 for my another component. Is there anything i must do to solve this problem ?
Thanks in advance for your help.
thangnn1510 Friendthangnn1510
- Join date:
- October 2014
- Posts:
- 1608
- Downloads:
- 0
- Uploads:
- 80
- Thanks:
- 73
- Thanked:
- 278 times in 256 posts
May 4, 2011 at 8:55 am #389767Could you give us the access (FTP/Admin info) to your support ticket HDS-563-40732. We’ll check for you.
May 16, 2011 at 2:16 am #391326I already sent my admin info. Went you open it, its need username and password … just use test (for username and password)
geraintedwards Friendgeraintedwards
- Join date:
- June 2007
- Posts:
- 7
- Downloads:
- 14
- Uploads:
- 0
- Thanked:
- 1 times in 1 posts
May 26, 2011 at 11:59 am #393008I ave the same issue on a local server (so can’t provide access details).
The issue is that this.options.wrapper is still set to the string ‘ja-slide-wrapper’ instead of being replaced with the dom element passed in bia the options argument to the initialize function.
A solution would be very welcome
geraintedwards Friendgeraintedwards
- Join date:
- June 2007
- Posts:
- 7
- Downloads:
- 14
- Uploads:
- 0
- Thanked:
- 1 times in 1 posts
May 26, 2011 at 2:17 pm #393024I found a solution – change the ja_contentslider2.js script to this :
var JS_ContentSlider2 = new Class({
Implements: Options,
options : {
w: 100,
h: 200,
num_elem: 4,
total: 0,
url: '',
mode: 'horizontal',
direction: 'right',
wrapper: 'ja-slide-wrapper',
duration: 1000,
interval: 3000,
auto: 1
},
initialize: function(options)
{
this.setOptions(options);
//this.options = options;
if (this.options.total){
if (this.options.total < this.options.num_elem) this.options.num_elem = this.options.total;
this.elements = new Array(this.options.total);
}else
this.elements = new Array();this.current = 0;
//this.options.wrapper.setStyle('position', 'relative');
//this.options.wrapper.setStyle('overflow', 'hidden');
if(this.options.mode=='vertical'){
this.options.wrapper.setStyle('width', this.options.w);
this.options.wrapper.setStyle('height', this.options.h*this.options.num_elem);
}else{
this.options.wrapper.setStyle('width', this.options.w*this.options.num_elem);
this.options.wrapper.setStyle('height', this.options.h);
}/*For element*/
elems = this.options.wrapper.getElementsByClassName ('content_element');
for(i=0;i<elems.length;i++){
elems.setStyle('width', this.options.w);
elems.setStyle('height', this.options.h);
}this.ef_u = {};
this.ef_d = {};
this.ef_l = {};
this.ef_r = {};
for(i=0;i<=this.options.num_elem;i++) {
this.ef_u = { 'top': [ i*this.options.h, (i-1)*this.options.h] };
this.ef_d = { 'top': [ (i-1)*this.options.h, i*this.options.h] };
this.ef_l = { 'left': [ i*this.options.w, (i-1)*this.options.w] };
this.ef_r = { 'left': [ (i-1)*this.options.w, i*this.options.w] };
}
},getFx: function(){
if (this.options.mode == 'vertical') {
if (this.options.direction == 'up') {
return this.ef_u;
}else{
return this.ef_d;
}
}else{
if (this.options.direction == 'left') {
return this.ef_l;
}else{
return this.ef_r;
}
}
},add: function(text){
var divobj = new Element('DIV', {
'id':'jsslide_' + this.elements.length,
'class':'jsslide',
'styles': {
'position': 'absolute',
'width': this.options.w,
'height': this.options.h
}});
divobj.innerHTML = text;
if(this.elements.length > 1) {
divobj.injectAfter (this.elements);
}else{
divobj.inject (this.options.wrapper);
}
this.hide(divobj);
this.elements.push(divobj);
},//Update element i
update: function (text, ind){
var divobj = new Element('DIV', {
'id':'jsslide_' + ind,
'class':'jsslide',
'rel': this.options.modid,
'styles': {
'position': 'absolute',
'width': this.options.w,
'height': this.options.h
}});
divobj.innerHTML = text;
divobj.inject (this.options.wrapper);
this.hide(divobj);
this.elements = divobj;
},hide: function (el) {
if (this.options.mode == 'vertical') {
el.setStyle('top', '-999px');
el.setStyle('left', '0');
}else{
el.setStyle('top', '0');
el.setStyle('left', '-999em');
}
},setPos: function (elems) {
if (!elems) elems = this.getRunElems();/*var limitW = this.options.wrapper.getStyle('width');
limitW = parseInt(limitW);
var limitH = this.options.wrapper.getStyle('height');
limitH = parseInt(limitH);*/var posT;
var posL;
var display;
for(var i=0;i<elems.length;i++) {
var el = elems;
if (el){
if (this.options.mode == 'vertical') {
if (this.options.direction == 'up') {
posT = this.options.h*i;
}else{
posT = this.options.h*(i-1);
}
el.setStyle('top', posT);if(posT >= 0) {
this.loadImage(el);
}
//display = (posT >= limitH || posT <0) ? 'none' : 'inline';
//el.setStyle('display', display);
}else{
if (this.options.direction == 'left') {
posL = this.options.w*i;
}else{
posL = this.options.w*(i-1);
}
el.setStyle('left', posL);this.loadImage(el);
//display = (posL >= limitW || posL <0) ? 'none' : 'inline';
//el.setStyle('display', display);
}
}
}
},loadImage: function(el) {
var holder = el.getElement(".ja-image");
if(holder){
var image = holder.getProperty('rel');
if(image != '' && image != null) {
holder.setHTML(image);
holder.setProperty('rel', '')
}
}
},getRunElems: function(){
var objs = new Array();
if(this.options.direction=='left' || this.options.direction=='up'){
adj = 0;
}else{
adj = this.elements.length-1;
}
for(var i=0;i<=this.options.num_elem;i++) {
objs = this.elements[(this.current+i+adj) % this.elements.length];
}
if (this.options.total <= this.options.num_elem) {
if(this.options.direction=='left' || this.options.direction=='up'){
objs = null;
}else{
objs[0] = null;
}
}
return objs;
},start: function () {
this.clearTimeOut();
if (!this.elements) {
this.nextRun();
return;
}
if (this.elements == 'fetching') {
this.nextRun();
return;
}
if(this.running) return;
this.running = 1;var objs = this.getRunElems();
this.setPos(objs);
this.x = new Fx.Elements(objs, {duration: this.options.duration, onComplete:this.end.bind(this)});
this.x.start(this.getFx());
this.current = this.nextCurr();
},end: function() {
this.running = 0;
this.nextRun();
},clearTimeOut: function(){
if(this.timeOut) {
clearTimeout(this.timeOut);
this.timeOut = 0;
}
},nextRun: function () {
this.clearTimeOut();
if (this.options.total <= this.options.num_elem) return;
if (this.options.auto){
this.timeOut = setTimeout(this.start.bind(this),this.options.interval);
//this.fetchNext();
}
},nextCurr: function () {
var next = 0;
if(this.options.direction=='left' || this.options.direction=='up'){
next = (this.current+1) % this.elements.length;
}else{
next = (this.current+this.elements.length-1) % this.elements.length;
}
return next;
},next: function () {
var next = 0;
if(this.options.direction=='left' || this.options.direction=='up'){
next = (this.current+this.options.num_elem) % this.elements.length;
}else{
next = (this.current+this.elements.length-1) % this.elements.length;
}
return next;
},fetchNext: function(){
var next = this.next();
//alert(this.current); && this.elements
if (!this.elements[next]){
this.elements[next] = 'fetching';
url = this.options.url + '?total='+this.options.total+'&news='+next+'&loadajax=1&modid='+this.options.modid;
new Ajax(url,{method:'get',onComplete:function(request){this.update(request,next)}.bind(this)}).request();
return;
}
},fetchUpdate: function(text,next){
this.update(text, next);
},setDirection: function (direction){
this.options.direction = direction;
}});
May 27, 2011 at 3:39 am #393088Yes, its working…thanks geraintedwards…:)
-
AuthorPosts
This topic contains 7 replies, has 4 voices, and was last updated by hoeks 12 years, 8 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum