Roundabot slideshow- javascriptinə animasiya verə bilmirəm

Salamlar! mənim javascriptnen bağlı problemim var. roundabout slideshow- javascriptinə hərəkət verə bilmirəm.

sizdən xahişim şəkilləri hərəkət vermək üçün buraya nələr əlavə edim? www.girdenigb.tk burdaki karusel hərəkət etsin nece edim?


Yadda saxlama
Kateqoriya: Web skriptlər, kod həlləri . . Qısa keçid.

Verilmiş cavablar və yazılan şərhlər (5 cavab var)

(21:17, 07/04/2012 ) #12190

Salam. Bəlli ki nədəsə səhv edirsiniz. Chrome-da Developer Tools-a girib Concole-u açın(və ya Firefox-da Firebug-u) səhifəni reload edib baxın görün hansı erroru verir. O error ilə bilərsiz səhvi. Bilməsəz erroru bura yazın.

Cavablamaq üçün sağ sütundan hesaba daxil olmaq lazımdır

(21:36, 07/04/2012 ) #12191

salam! sadece shekile avtoplay vermek isteyirem ve shekiller dayanmadan hereket etsin, men bura kodlari yazmishdim diyesen gorsenmiyib eledir? eger beledirse tezeden gondererem kodlari bura

Cavablamaq üçün sağ sütundan hesaba daxil olmaq lazımdır

(22:13, 07/04/2012 ) #12195

Sizdə belə bir kod var.

1$(document).ready(function() {
2 
3$('.round').roundabout();
4 
5});

bu kodda
$(‘.round’).roundabout();
bunu
$(‘.round’).roundabout(“startAutoplay”);
bununla əvəz edin.

Cavablamaq üçün sağ sütundan hesaba daxil olmaq lazımdır

(22:40, 07/04/2012 ) #12199

salam axşamınız xeyir! yoxladim kodu ancaq heç bir dəyişiklik olmadi, bəlkə js-də nəsə dəyişmək lazımdı?
buda js-dəki kodu:
// creates a default shape to be used for pathing
jQuery.extend({
roundabout_shape: {
def: ‘lazySusan’,
lazySusan: function(r, a, t) {
return {
x: Math.sin(r + a),
y: (Math.sin(r + 3*Math.PI/2 + a) / 8) * t,
z: (Math.cos(r + a) + 1) / 2,
scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5
};
}
}
});

jQuery.fn.roundabout = function() {
var options = (typeof arguments[0] != ‘object’) ? {} : arguments[0];

// set options and fill in defaults
options = {
bearing: (typeof options.bearing == ‘undefined’) ? 0.0 : jQuery.roundabout_toFloat(options.bearing % 360.0),
tilt: (typeof options.tilt == ‘undefined’) ? 0.0 : jQuery.roundabout_toFloat(options.tilt),
minZ: (typeof options.minZ == ‘undefined’) ? 100 : parseInt(options.minZ, 10),
maxZ: (typeof options.maxZ == ‘undefined’) ? 400 : parseInt(options.maxZ, 10),
minOpacity: (typeof options.minOpacity == ‘undefined’) ? 0.40 : jQuery.roundabout_toFloat(options.minOpacity),
maxOpacity: (typeof options.maxOpacity == ‘undefined’) ? 1.00 : jQuery.roundabout_toFloat(options.maxOpacity),
minScale: (typeof options.minScale == ‘undefined’) ? 0.40 : jQuery.roundabout_toFloat(options.minScale),
maxScale: (typeof options.maxScale == ‘undefined’) ? 1.00 : jQuery.roundabout_toFloat(options.maxScale),
duration: (typeof options.duration == ‘undefined’) ? 600 : parseInt(options.duration, 10),
btnNext: options.btnNext || null,
btnPrev: options.btnPrev || null,
easing: options.easing || ‘swing’,
clickToFocus: (options.clickToFocus !== false),
focusBearing: (typeof options.focusBearing == ‘undefined’) ? 0.0 : jQuery.roundabout_toFloat(options.focusBearing % 360.0),
shape: options.shape || ‘lazySusan’,
debug: options.debug || false,
childSelector: options.childSelector || ‘li’,
startingChild: (typeof options.startingChild == ‘undefined’) ? null : parseInt(options.startingChild, 10),
reflect: (typeof options.reflect == ‘undefined’ || options.reflect === false) ? false : true
};

// assign things
this.each(function(i) {
var ref = jQuery(this);
var period = jQuery.roundabout_toFloat(360.0 / ref.children(options.childSelector).length);
var startingBearing = (options.startingChild === null) ? options.bearing : options.startingChild * period;

// set starting styles
ref
.addClass(’roundabout-holder’)
.css(‘padding’, 0)
.css(‘position’, ‘relative’)
.css(‘z-index’, options.minZ);

// set starting options
ref.data(’roundabout’, {
‘bearing’: startingBearing,
’tilt’: options.tilt,
‘minZ’: options.minZ,
‘maxZ’: options.maxZ,
‘minOpacity’: options.minOpacity,
‘maxOpacity’: options.maxOpacity,
‘minScale’: options.minScale,
‘maxScale’: options.maxScale,
‘duration’: options.duration,
‘easing’: options.easing,
‘clickToFocus’: options.clickToFocus,
‘focusBearing’: options.focusBearing,
‘animating’: 0,
‘childInFocus’: -1,
‘shape’: options.shape,
‘period’: period,
‘debug’: options.debug,
‘childSelector’: options.childSelector,
‘reflect’: options.reflect
});

// bind click events
if (options.clickToFocus === true) {
ref.children(options.childSelector).each(function(i) {
jQuery(this).click(function(e) {
var degrees = (options.reflect === true) ? 360.0 – (period * i) : period * i;
degrees = jQuery.roundabout_toFloat(degrees);
if (!jQuery.roundabout_isInFocus(ref, degrees)) {
e.preventDefault();
if (ref.data(’roundabout’).animating === 0) {
ref.roundabout_animateAngleToFocus(degrees);
}
return false;
}
});
});
}

// bind next buttons
if (options.btnNext) {
jQuery(options.btnNext).bind(‘click.roundabout’, function(e) {
e.preventDefault();
if (ref.data(’roundabout’).animating === 0) {
ref.roundabout_animateToNextChild();
}
return false;
});
}

// bind previous buttons
if (options.btnPrev) {
jQuery(options.btnPrev).bind(‘click.roundabout’, function(e) {
e.preventDefault();
if (ref.data(’roundabout’).animating === 0) {
ref.roundabout_animateToPreviousChild();
}
return false;
});
}
});

// start children
this.roundabout_startChildren();

// callback once ready
if (typeof arguments[1] === ‘function’) {
var callback = arguments[1], ref = this;
setTimeout(function() { callback(ref); }, 0);
}

return this;
};

jQuery.fn.roundabout_startChildren = function() {
this.each(function(i) {
var ref = jQuery(this);
var data = ref.data(’roundabout’);
var children = ref.children(data.childSelector);

children.each(function(i) {
var degrees = (data.reflect === true) ? 360.0 – (data.period * i) : data.period * i;

// apply classes and css first
jQuery(this)
.addClass(’roundabout-moveable-item’)
.css(‘position’, ‘absolute’);

// then measure
jQuery(this).data(’roundabout’, {
‘startWidth’: jQuery(this).width(),
‘startHeight’: jQuery(this).height(),
‘startFontSize’: parseInt(jQuery(this).css(‘font-size’), 10),
‘degrees’: degrees
});
});

ref.roundabout_updateChildPositions();
});
return this;
};

jQuery.fn.roundabout_setTilt = function(newTilt) {
this.each(function(i) {
jQuery(this).data(’roundabout’).tilt = newTilt;
jQuery(this).roundabout_updateChildPositions();
});

if (typeof arguments[1] === ‘function’) {
var callback = arguments[1], ref = this;
setTimeout(function() { callback(ref); }, 0);
}

return this;
};

jQuery.fn.roundabout_setBearing = function(newBearing) {
this.each(function(i) {
jQuery(this).data(’roundabout’).bearing = jQuery.roundabout_toFloat(newBearing % 360, 2);
jQuery(this).roundabout_updateChildPositions();
});

if (typeof arguments[1] === ‘function’) {
var callback = arguments[1], ref = this;
setTimeout(function() { callback(ref); }, 0);
}

return this;
};

jQuery.fn.roundabout_adjustBearing = function(delta) {
delta = jQuery.roundabout_toFloat(delta);
if (delta !== 0) {
this.each(function(i) {
jQuery(this).data(’roundabout’).bearing = jQuery.roundabout_getBearing(jQuery(this)) + delta;
jQuery(this).roundabout_updateChildPositions();
});
}

if (typeof arguments[1] === ‘function’) {
var callback = arguments[1], ref = this;
setTimeout(function() { callback(ref); }, 0);
}

return this;
};

jQuery.fn.roundabout_adjustTilt = function(delta) {
delta = jQuery.roundabout_toFloat(delta);
if (delta !== 0) {
this.each(function(i) {
jQuery(this).data(’roundabout’).tilt = jQuery.roundabout_toFloat(jQuery(this).roundabout_get(’tilt’) + delta);
jQuery(this).roundabout_updateChildPositions();
});
}

if (typeof arguments[1] === ‘function’) {
var callback = arguments[1], ref = this;
setTimeout(function() { callback(ref); }, 0);
}

return this;
};

jQuery.fn.roundabout_animateToBearing = function(bearing) {
bearing = jQuery.roundabout_toFloat(bearing);
var currentTime = new Date();
var duration = (typeof arguments[1] == ‘undefined’) ? null : arguments[1];
var easingType = (typeof arguments[2] == ‘undefined’) ? null : arguments[2];
var passedData = (typeof arguments[3] !== ‘object’) ? null : arguments[3];

this.each(function(i) {
var ref = jQuery(this), data = ref.data(’roundabout’), timer, easingFn, newBearing;
var thisDuration = (duration === null) ? data.duration : duration;
var thisEasingType = (easingType !== null) ? easingType : data.easing || ‘swing’;

if (passedData === null) {
passedData = {
timerStart: currentTime,
start: jQuery.roundabout_getBearing(ref),
totalTime: thisDuration
};
}
timer = currentTime – passedData.timerStart;

if (timer < thisDuration) {
data.animating = 1;

if (typeof jQuery.easing.def == 'string') {
easingFn = jQuery.easing[thisEasingType] || jQuery.easing[jQuery.easing.def];
newBearing = easingFn(null, timer, passedData.start, bearing – passedData.start, passedData.totalTime);
} else {
newBearing = jQuery.easing[thisEasingType]((timer / passedData.totalTime), timer, passedData.start, bearing – passedData.start, passedData.totalTime);
}

ref.roundabout_setBearing(newBearing, function() { ref.roundabout_animateToBearing(bearing, thisDuration, thisEasingType, passedData); });
} else {
bearing = (bearing < 0) ? bearing + 360 : bearing % 360;
data.animating = 0;
ref.roundabout_setBearing(bearing);
}
});
return this;
};

jQuery.fn.roundabout_animateToDelta = function(delta) {
var duration = arguments[1], easing = arguments[2];
this.each(function(i) {
delta = jQuery.roundabout_getBearing(jQuery(this)) + jQuery.roundabout_toFloat(delta);
jQuery(this).roundabout_animateToBearing(delta, duration, easing);
});
return this;
};

jQuery.fn.roundabout_animateToChild = function(childPos) {
var duration = arguments[1], easing = arguments[2];
this.each(function(i) {
var ref = jQuery(this), data = ref.data('roundabout');
if (data.childInFocus !== childPos && data.animating === 5) {
var child = jQuery(ref.children(data.childSelector)[childPos]);
ref.roundabout_animateAngleToFocus(child.data('roundabout').degrees, duration, easing);
}
});
return this;
};

jQuery.fn.roundabout_animateToNearbyChild = function(passedArgs, which) {
var duration = passedArgs[0], easing = passedArgs[1];
this.each(function(i) {
var data = jQuery(this).data('roundabout');
var bearing = jQuery.roundabout_toFloat(360.0 – jQuery.roundabout_getBearing(jQuery(this)));
var period = data.period, j = 0, range;
var reflect = data.reflect;
var length = jQuery(this).children(data.childSelector).length;

bearing = (reflect === true) ? bearing % 360.0 : bearing;

if (data.animating === 0) {
// if we're not reflecting and we're moving to next or
// we are reflecting and we're moving previous
if ((reflect === false && which === 'next') || (reflect === true && which !== 'next')) {
bearing = (bearing === 0) ? 360 : bearing;

// counterclockwise
while (true && j < length) {
range = { lower: jQuery.roundabout_toFloat(period * j), upper: jQuery.roundabout_toFloat(period * (j + 1)) };
range.upper = (j == length – 1) ? 360.0 : range.upper; // adjust for javascript being bad at floats

if (bearing range.lower) {
jQuery(this).roundabout_animateToDelta(bearing – range.lower, duration, easing);
break;
}
j++;
}
} else {
// clockwise
while (true) {
range = { lower: jQuery.roundabout_toFloat(period * j), upper: jQuery.roundabout_toFloat(period * (j + 1)) };
range.upper = (j == length – 1) ? 360.0 : range.upper; // adjust for javascript being bad at floats

if (bearing >= range.lower && bearing < range.upper) {
jQuery(this).roundabout_animateToDelta(bearing – range.upper, duration, easing);
break;
}
j++;
}
}
}
});
return this;
};

jQuery.fn.roundabout_animateToNextChild = function() {
return this.roundabout_animateToNearbyChild(arguments, 'next');
};

jQuery.fn.roundabout_animateToPreviousChild = function() {
return this.roundabout_animateToNearbyChild(arguments, 'previous');
};

// moves a given angle to the focus by the shortest means possible
jQuery.fn.roundabout_animateAngleToFocus = function(target) {
var duration = arguments[1], easing = arguments[2];
this.each(function(i) {
var delta = jQuery.roundabout_getBearing(jQuery(this)) – target;
delta = (Math.abs(360.0 – delta) 180) ? -(360.0 – delta) : delta;

if (delta !== 0) {
jQuery(this).roundabout_animateToDelta(delta, duration, easing);
}
});
return this;
};

jQuery.fn.roundabout_updateChildPositions = function() {
this.each(function(i) {
var ref = jQuery(this), data = ref.data(’roundabout’);
var inFocus = -1;
var info = {
bearing: jQuery.roundabout_getBearing(ref),
tilt: data.tilt,
stage: { width: Math.floor(ref.width() * 0.9), height: Math.floor(ref.height() * 0.9) },
animating: data.animating,
inFocus: data.childInFocus,
focusBearingRad: jQuery.roundabout_degToRad(data.focusBearing),
shape: jQuery.roundabout_shape[data.shape] || jQuery.roundabout_shape[jQuery.roundabout_shape.def]
};
info.midStage = { width: info.stage.width / 2, height: info.stage.height / 2 };
info.nudge = { width: info.midStage.width + info.stage.width * 0.05, height: info.midStage.height + info.stage.height * 0.05 };
info.zValues = { min: data.minZ, max: data.maxZ, diff: data.maxZ – data.minZ };
info.opacity = { min: data.minOpacity, max: data.maxOpacity, diff: data.maxOpacity – data.minOpacity };
info.scale = { min: data.minScale, max: data.maxScale, diff: data.maxScale – data.minScale };

// update child positions
ref.children(data.childSelector).each(function(i) {
if (jQuery.roundabout_updateChildPosition(jQuery(this), ref, info, i) && info.animating === 0) {
inFocus = i;
jQuery(this).addClass(’roundabout-in-focus’);
} else {
jQuery(this).removeClass(’roundabout-in-focus’);
}
});

// update status of who is in focus
if (inFocus !== info.inFocus) {
jQuery.roundabout_triggerEvent(ref, info.inFocus, ‘blur’);

if (inFocus !== -1) {
jQuery.roundabout_triggerEvent(ref, inFocus, ‘focus’);
}

data.childInFocus = inFocus;
}
});
return this;
};

//—————-

jQuery.roundabout_getBearing = function(el) {
return jQuery.roundabout_toFloat(el.data(’roundabout’).bearing) % 360;
};

jQuery.roundabout_degToRad = function(degrees) {
return (degrees % 360.0) * Math.PI / 180.0;
};

jQuery.roundabout_isInFocus = function(el, target) {
return (jQuery.roundabout_getBearing(el) % 360 === (target % 360));
};

jQuery.roundabout_triggerEvent = function(el, child, eventType) {
return (child < 0) ? this : jQuery(el.children(el.data('roundabout').childSelector)[child]).trigger(eventType);
};

jQuery.roundabout_toFloat = function(number) {
number = Math.round(parseFloat(number) * 1000) / 1000;
return parseFloat(number.toFixed(2));
};

jQuery.roundabout_updateChildPosition = function(child, container, info, childPos) {
var ref = jQuery(child), data = ref.data('roundabout'), out = [];
var rad = jQuery.roundabout_degToRad((360.0 – ref.data('roundabout').degrees) + info.bearing);

// adjust radians to be between 0 and Math.PI * 2
while (rad Math.PI * 2) {
rad = rad – Math.PI * 2;
}

var factors = info.shape(rad, info.focusBearingRad, info.tilt); // obj with x, y, z, and scale values

// correct
factors.scale = (factors.scale > 1) ? 1 : factors.scale;
factors.adjustedScale = (info.scale.min + (info.scale.diff * factors.scale)).toFixed(4);
factors.width = (factors.adjustedScale * data.startWidth).toFixed(4);
factors.height = (factors.adjustedScale * data.startHeight).toFixed(4);

// alter item
ref
.css(‘left’, ((factors.x * info.midStage.width + info.nudge.width) – factors.width / 2.0).toFixed(1) + ‘px’)
.css(‘top’, ((factors.y * info.midStage.height + info.nudge.height) – factors.height / 2.0).toFixed(1) + ‘px’)
.css(‘width’, factors.width + ‘px’)
.css(‘height’, factors.height + ‘px’)
.css(‘opacity’, (info.opacity.min + (info.opacity.diff * factors.scale)).toFixed(2))
.css(‘z-index’, Math.round(info.zValues.min + (info.zValues.diff * factors.z)))
.css(‘font-size’, (factors.adjustedScale * data.startFontSize).toFixed(2) + ‘px’)
.attr(‘current-scale’, factors.adjustedScale);

if (container.data(’roundabout’).debug === true) {
out.push(”);
out.push(‘Child ‘ + childPos + ‘‘);
out.push(‘left: ‘ + ref.css(‘left’) + ‘top: ‘ + ref.css(‘top’) + ”);
out.push(‘width: ‘ + ref.css(‘width’) + ‘opacity: ‘ + ref.css(‘opacity’) + ”);
out.push(‘z-index: ‘ + ref.css(‘z-index’) + ‘font-size: ‘ + ref.css(‘font-size’) + ”);
out.push(‘scale: ‘ + ref.attr(‘current-scale’));
out.push(”);

ref.html(out.join(”));
}

return jQuery.roundabout_isInFocus(container, ref.data(’roundabout’).degrees);
};

Cavablamaq üçün sağ sütundan hesaba daxil olmaq lazımdır

(23:46, 07/04/2012 ) #12202
1... //... creates a default shape to be used for pathing
2jQuery.extend({
3    roundabout_shape: {
4        def: 'lazySusan',
5        lazySusan: function(r, a, t) {
6            return {
7                x: Math.sin(r + a),
8                y: (Math.sin(r + 3*Math.PI/2 + a) / 8) * t,
9                z: (Math.cos(r + a) + 1) / 2,
10                scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5
11            };
12        }
13    }
14});
15 
16jQuery.fn.roundabout = function() {
17    var options = (typeof arguments[0] != 'object') ? {} : arguments[0];
18 
19    // set options and fill in defaults
20    options = {
21        bearing: (typeof options.bearing == 'undefined') ? 0.0 : jQuery.roundabout_toFloat(options.bearing % 360.0),
22        tilt: (typeof options.tilt == 'undefined') ? 0.0 : jQuery.roundabout_toFloat(options.tilt),
23        minZ: (typeof options.minZ == 'undefined') ? 100 : parseInt(options.minZ, 10),
24        maxZ: (typeof options.maxZ == 'undefined') ? 400 : parseInt(options.maxZ, 10),
25        minOpacity: (typeof options.minOpacity == 'undefined') ? 0.40 : jQuery.roundabout_toFloat(options.minOpacity),
26        maxOpacity: (typeof options.maxOpacity == 'undefined') ? 1.00 : jQuery.roundabout_toFloat(options.maxOpacity),
27        minScale: (typeof options.minScale == 'undefined') ? 0.40 : jQuery.roundabout_toFloat(options.minScale),
28        maxScale: (typeof options.maxScale == 'undefined') ? 1.00 : jQuery.roundabout_toFloat(options.maxScale),
29        duration: (typeof options.duration == 'undefined') ? 600 : parseInt(options.duration, 10),
30        btnNext: options.btnNext || null,
31        btnPrev: options.btnPrev || null,
32        easing: options.easing || 'swing',
33        clickToFocus: (options.clickToFocus !== false),
34        focusBearing: (typeof options.focusBearing == 'undefined') ? 0.0 : jQuery.roundabout_toFloat(options.focusBearing % 360.0),
35        shape: options.shape || 'lazySusan',
36        debug: options.debug || false,
37        childSelector: options.childSelector || 'li',
38        startingChild: (typeof options.startingChild == 'undefined') ? null : parseInt(options.startingChild, 10),
39        reflect: (typeof options.reflect == 'undefined' || options.reflect === false) ? false : true
40    };
41 
42    // assign things
43    this.each(function(i) {
44        var ref = jQuery(this);
45        var period = jQuery.roundabout_toFloat(360.0 / ref.children(options.childSelector).length);
46        var startingBearing = (options.startingChild === null) ? options.bearing : options.startingChild * period;
47         
48        // set starting styles
49        ref
50            .addClass('roundabout-holder')
51            .css('padding', 0)
52            .css('position', 'relative')
53            .css('z-index', options.minZ);
54         
55        // set starting options
56        ref.data('roundabout', {
57            'bearing': startingBearing,
58            'tilt': options.tilt,
59            'minZ': options.minZ,
60            'maxZ': options.maxZ,
61            'minOpacity': options.minOpacity,
62            'maxOpacity': options.maxOpacity,
63            'minScale': options.minScale,
64            'maxScale': options.maxScale,
65            'duration': options.duration,
66            'easing': options.easing,
67            'clickToFocus': options.clickToFocus,
68            'focusBearing': options.focusBearing,
69            'animating': 0,
70            'childInFocus': -1,
71            'shape': options.shape,
72            'period': period,
73            'debug': options.debug,
74            'childSelector': options.childSelector,
75            'reflect': options.reflect
76        });
77                 
78        // bind click events
79        if (options.clickToFocus === true) {
80            ref.children(options.childSelector).each(function(i) {
81                jQuery(this).click(function(e) {
82                    var degrees = (options.reflect === true) ? 360.0 - (period * i) : period * i;
83                    degrees = jQuery.roundabout_toFloat(degrees);
84                    if (!jQuery.roundabout_isInFocus(ref, degrees)) {
85                        e.preventDefault();
86                        if (ref.data('roundabout').animating === 0) {
87                            ref.roundabout_animateAngleToFocus(degrees);
88                        }
89                        return false;
90                    }
91                });
92            });
93        }
94         
95        // bind next buttons
96        if (options.btnNext) {
97            jQuery(options.btnNext).bind('click.roundabout', function(e) {
98                e.preventDefault();
99                if (ref.data('roundabout').animating === 0) {
100                    ref.roundabout_animateToNextChild();
101                }
102                return false;
103            });
104        }
105         
106        // bind previous buttons
107        if (options.btnPrev) {
108            jQuery(options.btnPrev).bind('click.roundabout', function(e) {
109                e.preventDefault();
110                if (ref.data('roundabout').animating === 0) {
111                    ref.roundabout_animateToPreviousChild();
112                }
113                return false;
114            });
115        }
116    });
117 
118    // start children
119    this.roundabout_startChildren();
120 
121    // callback once ready
122    if (typeof arguments[1] === 'function') {
123        var callback = arguments[1], ref = this;
124        setTimeout(function() { callback(ref); }, 0);
125    }
126 
127    return this;
128};
129 
130jQuery.fn.roundabout_startChildren = function() {
131    this.each(function(i) {
132        var ref = jQuery(this);
133        var data = ref.data('roundabout');
134        var children = ref.children(data.childSelector);
135         
136        children.each(function(i) {
137            var degrees = (data.reflect === true) ? 360.0 - (data.period * i) : data.period * i;
138 
139            // apply classes and css first
140            jQuery(this)
141                .addClass('roundabout-moveable-item')
142                .css('position', 'absolute');
143             
144            // then measure
145            jQuery(this).data('roundabout', {
146                'startWidth': jQuery(this).width(),
147                'startHeight': jQuery(this).height(),
148                'startFontSize': parseInt(jQuery(this).css('font-size'), 10),
149                'degrees': degrees
150            });
151        });
152         
153        ref.roundabout_updateChildPositions();
154    });
155    return this;
156};
157 
158jQuery.fn.roundabout_setTilt = function(newTilt) {
159    this.each(function(i) {
160        jQuery(this).data('roundabout').tilt = newTilt;
161        jQuery(this).roundabout_updateChildPositions();
162    });
163     
164    if (typeof arguments[1] === 'function') {
165        var callback = arguments[1], ref = this;
166        setTimeout(function() { callback(ref); }, 0);
167    }
168     
169    return this;
170};
171 
172jQuery.fn.roundabout_setBearing = function(newBearing) {
173    this.each(function(i) {
174        jQuery(this).data('roundabout').bearing = jQuery.roundabout_toFloat(newBearing % 360, 2);
175        jQuery(this).roundabout_updateChildPositions();
176    });
177 
178    if (typeof arguments[1] === 'function') {
179        var callback = arguments[1], ref = this;
180        setTimeout(function() { callback(ref); }, 0);
181    }
182     
183    return this;
184};
185 
186jQuery.fn.roundabout_adjustBearing = function(delta) {
187    delta = jQuery.roundabout_toFloat(delta);
188    if (delta !== 0) {
189        this.each(function(i) {
190            jQuery(this).data('roundabout').bearing = jQuery.roundabout_getBearing(jQuery(this)) + delta;
191            jQuery(this).roundabout_updateChildPositions();
192        });
193    }
194     
195    if (typeof arguments[1] === 'function') {
196        var callback = arguments[1], ref = this;
197        setTimeout(function() { callback(ref); }, 0);
198    }
199 
200    return this;
201};
202 
203jQuery.fn.roundabout_adjustTilt = function(delta) {
204    delta = jQuery.roundabout_toFloat(delta);
205    if (delta !== 0) {
206        this.each(function(i) {
207            jQuery(this).data('roundabout').tilt = jQuery.roundabout_toFloat(jQuery(this).roundabout_get('tilt') + delta);
208            jQuery(this).roundabout_updateChildPositions();
209        });
210    }
211     
212    if (typeof arguments[1] === 'function') {
213        var callback = arguments[1], ref = this;
214        setTimeout(function() { callback(ref); }, 0);
215    }
216 
217    return this;
218};
219 
220jQuery.fn.roundabout_animateToBearing = function(bearing) {
221    bearing = jQuery.roundabout_toFloat(bearing);
222    var currentTime = new Date();
223    var duration    = (typeof arguments[1] == 'undefined') ? null : arguments[1];
224    var easingType  = (typeof arguments[2] == 'undefined') ? null : arguments[2];
225    var passedData  = (typeof arguments[3] !== 'object')   ? null : arguments[3];
226 
227    this.each(function(i) {
228        var ref = jQuery(this), data = ref.data('roundabout'), timer, easingFn, newBearing;
229        var thisDuration = (duration === null) ? data.duration : duration;
230        var thisEasingType = (easingType !== null) ? easingType : data.easing || 'swing';
231 
232        if (passedData === null) {
233            passedData = {
234                timerStart: currentTime,
235                start: jQuery.roundabout_getBearing(ref),
236                totalTime: thisDuration
237            };
238        }
239        timer = currentTime - passedData.timerStart;
240 
241        if (timer < thisDuration) {
242            data.animating = 1;
243             
244            if (typeof jQuery.easing.def == 'string') {
245                easingFn = jQuery.easing[thisEasingType] || jQuery.easing[jQuery.easing.def];
246                newBearing = easingFn(null, timer, passedData.start, bearing - passedData.start, passedData.totalTime);
247            } else {
248                newBearing = jQuery.easing[thisEasingType]((timer / passedData.totalTime), timer, passedData.start, bearing - passedData.start, passedData.totalTime);
249            }
250             
251            ref.roundabout_setBearing(newBearing, function() { ref.roundabout_animateToBearing(bearing, thisDuration, thisEasingType, passedData); });
252        } else {
253            bearing = (bearing < 0) ? bearing + 360 : bearing % 360;
254            data.animating = 0;
255            ref.roundabout_setBearing(bearing);
256        }
257    });
258    return this;
259};
260 
261jQuery.fn.roundabout_animateToDelta = function(delta) {
262    var duration = arguments[1], easing = arguments[2];
263    this.each(function(i) {
264        delta = jQuery.roundabout_getBearing(jQuery(this)) + jQuery.roundabout_toFloat(delta);
265        jQuery(this).roundabout_animateToBearing(delta, duration, easing);
266    });
267    return this;
268};
269 
270jQuery.fn.roundabout_animateToChild = function(childPos) { 
271    var duration = arguments[1], easing = arguments[2];
272    this.each(function(i) {
273        var ref = jQuery(this), data = ref.data('roundabout');
274        if (data.childInFocus !== childPos && data.animating === 5) {      
275            var child = jQuery(ref.children(data.childSelector)[childPos]);
276            ref.roundabout_animateAngleToFocus(child.data('roundabout').degrees, duration, easing);
277        }
278    });
279    return this;
280};
281 
282jQuery.fn.roundabout_animateToNearbyChild = function(passedArgs, which) {
283    var duration = passedArgs[0], easing = passedArgs[1];
284    this.each(function(i) {
285        var data     = jQuery(this).data('roundabout');
286        var bearing  = jQuery.roundabout_toFloat(360.0 - jQuery.roundabout_getBearing(jQuery(this)));
287        var period   = data.period, j = 0, range;
288        var reflect  = data.reflect;
289        var length   = jQuery(this).children(data.childSelector).length;
290 
291        bearing = (reflect === true) ? bearing % 360.0 : bearing;
292         
293        if (data.animating === 0) {
294            // if we're not reflecting and we're moving to next or
295            //    we are reflecting and we're moving previous
296            if ((reflect === false && which === 'next') || (reflect === true && which !== 'next')) {
297                bearing = (bearing === 0) ? 360 : bearing;
298                             
299                // counterclockwise
300                while (true && j < length) {
301                    range = { lower: jQuery.roundabout_toFloat(period * j), upper: jQuery.roundabout_toFloat(period * (j + 1)) };
302                    range.upper = (j == length - 1) ? 360.0 : range.upper;  // adjust for javascript being bad at floats
303 
304                    if (bearing <= range.upper && bearing > range.lower) {
305                        jQuery(this).roundabout_animateToDelta(bearing - range.lower, duration, easing);
306                        break;
307                    }
308                    j++;
309                }
310            } else {
311                // clockwise
312                while (true) {
313                    range = { lower: jQuery.roundabout_toFloat(period * j), upper: jQuery.roundabout_toFloat(period * (j + 1)) };
314                    range.upper = (j == length - 1) ? 360.0 : range.upper;  // adjust for javascript being bad at floats
315 
316                    if (bearing >= range.lower && bearing < range.upper) {
317                        jQuery(this).roundabout_animateToDelta(bearing - range.upper, duration, easing);
318                        break;
319                    }
320                    j++;
321                }
322            }
323        }
324    });
325    return this;
326};
327 
328jQuery.fn.roundabout_animateToNextChild = function() { 
329    return this.roundabout_animateToNearbyChild(arguments, 'next');
330};
331 
332jQuery.fn.roundabout_animateToPreviousChild = function() { 
333    return this.roundabout_animateToNearbyChild(arguments, 'previous');
334};
335 
336// moves a given angle to the focus by the shortest means possible
337jQuery.fn.roundabout_animateAngleToFocus = function(target) {
338    var duration = arguments[1], easing = arguments[2];
339    this.each(function(i) {
340        var delta = jQuery.roundabout_getBearing(jQuery(this)) - target;
341        delta = (Math.abs(360.0 - delta) < Math.abs(0.0 - delta)) ? 360.0 - delta : 0.0 - delta;
342        delta = (delta > 180) ? -(360.0 - delta) : delta;
343         
344        if (delta !== 0) {
345            jQuery(this).roundabout_animateToDelta(delta, duration, easing);   
346        }
347    });
348    return this;
349};
350 
351jQuery.fn.roundabout_updateChildPositions = function() {
352    this.each(function(i) {
353        var ref = jQuery(this), data = ref.data('roundabout');
354        var inFocus = -1;
355        var info = {
356            bearing: jQuery.roundabout_getBearing(ref),
357            tilt: data.tilt,
358            stage: { width: Math.floor(ref.width() * 0.9), height: Math.floor(ref.height() * 0.9) },
359            animating: data.animating,
360            inFocus: data.childInFocus,
361            focusBearingRad: jQuery.roundabout_degToRad(data.focusBearing),
362            shape: jQuery.roundabout_shape[data.shape] || jQuery.roundabout_shape[jQuery.roundabout_shape.def]
363        };
364        info.midStage = { width: info.stage.width / 2, height: info.stage.height / 2 };
365        info.nudge = { width: info.midStage.width + info.stage.width * 0.05, height: info.midStage.height + info.stage.height * 0.05 };
366        info.zValues = { min: data.minZ, max: data.maxZ, diff: data.maxZ - data.minZ };
367        info.opacity = { min: data.minOpacity, max: data.maxOpacity, diff: data.maxOpacity - data.minOpacity };
368        info.scale = { min: data.minScale, max: data.maxScale, diff: data.maxScale - data.minScale };
369 
370        // update child positions
371        ref.children(data.childSelector).each(function(i) {
372            if (jQuery.roundabout_updateChildPosition(jQuery(this), ref, info, i) && info.animating === 0) {
373                inFocus = i;
374                jQuery(this).addClass('roundabout-in-focus');
375            } else {
376                jQuery(this).removeClass('roundabout-in-focus');
377            }
378        });
379 
380        // update status of who is in focus
381        if (inFocus !== info.inFocus) {
382            jQuery.roundabout_triggerEvent(ref, info.inFocus, 'blur');
383 
384            if (inFocus !== -1) {
385                jQuery.roundabout_triggerEvent(ref, inFocus, 'focus');
386            }
387 
388            data.childInFocus = inFocus;
389        }
390    });
391    return this;   
392};
393 
394//----------------
395 
396jQuery.roundabout_getBearing = function(el) {
397    return jQuery.roundabout_toFloat(el.data('roundabout').bearing) % 360;
398};
399 
400jQuery.roundabout_degToRad = function(degrees) {
401    return (degrees % 360.0) * Math.PI / 180.0;
402};
403 
404jQuery.roundabout_isInFocus = function(el, target) {
405    return (jQuery.roundabout_getBearing(el) % 360 === (target % 360));
406};
407 
408jQuery.roundabout_triggerEvent = function(el, child, eventType) {
409    return (child < 0) ? this : jQuery(el.children(el.data('roundabout').childSelector)[child]).trigger(eventType);
410};
411 
412jQuery.roundabout_toFloat = function(number) {
413    number = Math.round(parseFloat(number) * 1000) / 1000;
414    return parseFloat(number.toFixed(2));
415};
416 
417jQuery.roundabout_updateChildPosition = function(child, container, info, childPos) {
418    var ref = jQuery(child), data = ref.data('roundabout'), out = [];
419    var rad = jQuery.roundabout_degToRad((360.0 - ref.data('roundabout').degrees) + info.bearing);
420     
421    // adjust radians to be between 0 and Math.PI * 2
422    while (rad < 0) {
423        rad = rad + Math.PI * 2;
424    }
425    while (rad > Math.PI * 2) {
426        rad = rad - Math.PI * 2;
427    }
428     
429    var factors = info.shape(rad, info.focusBearingRad, info.tilt); // obj with x, y, z, and scale values
430 
431    // correct
432    factors.scale = (factors.scale > 1) ? 1 : factors.scale;
433    factors.adjustedScale = (info.scale.min + (info.scale.diff * factors.scale)).toFixed(4);
434    factors.width = (factors.adjustedScale * data.startWidth).toFixed(4);
435    factors.height = (factors.adjustedScale * data.startHeight).toFixed(4);
436     
437    // alter item
438    ref
439        .css('left', ((factors.x * info.midStage.width + info.nudge.width) - factors.width / 2.0).toFixed(1) + 'px')
440        .css('top', ((factors.y * info.midStage.height + info.nudge.height) - factors.height / 2.0).toFixed(1) + 'px')
441        .css('width', factors.width + 'px')
442        .css('height', factors.height + 'px')
443        .css('opacity', (info.opacity.min + (info.opacity.diff * factors.scale)).toFixed(2))
444        .css('z-index', Math.round(info.zValues.min + (info.zValues.diff * factors.z)))
445        .css('font-size', (factors.adjustedScale * data.startFontSize).toFixed(2) + 'px')
446        .attr('current-scale', factors.adjustedScale);
447     
448    if (container.data('roundabout').debug === true) {
449        out.push('<div style="font-weight: normal; font-size: 10px; padding: 2px; width: ' + ref.css('width') + '; background-color: #ffc;">');
450        out.push('<strong style="font-size: 12px; white-space: nowrap;">Child ' + childPos + '</strong><br />');
451        out.push('<strong>left:</strong> ' + ref.css('left') + '<br /><strong>top:</strong> ' + ref.css('top') + '<br />');
452        out.push('<strong>width:</strong> ' + ref.css('width') + '<br /><strong>opacity:</strong> ' + ref.css('opacity') + '<br />');
453        out.push('<strong>z-index:</strong> ' + ref.css('z-index') + '<br /><strong>font-size:</strong> ' + ref.css('font-size') + '<br />');
454        out.push('<strong>scale:</strong> ' + ref.attr('current-scale'));
455        out.push('</div>');
456         
457        ref.html(out.join(''));
458    }
459 
460    return jQuery.roundabout_isInFocus(container, ref.data('roundabout').degrees);
461};...
Cavablamaq üçün sağ sütundan hesaba daxil olmaq lazımdır

Bu suala aid öz sualım var:
Sual verin
Bu suala cavab vermək istəyirəm:
Cavab verin

Cavab verin


Cavab yazmaq üçün lütfən sağ sütundan və ya buradan hesaba daxil olun.

Üzvlər üçün giriş

Qeydiyyat
Login with Facebook

Elan qutusu

Son cavablar və şərhlər

SN cavab verdi - Kripto vergi (1 gün əvvəl)

Nicat97 cavab verdi - ilkaddimlar.com-a nə oldu? (8 gün əvvəl)

nicatmemmedli cavab verdi - Proqramlaşdırma - fəlsəfə (11 gün əvvəl)

nicatmemmedli cavab verdi - ilkaddimlar.com-a nə oldu? (11 gün əvvəl)

Software Developer cavab verdi - ilkaddimlar.com-a nə oldu? (22 gün əvvəl)

E. Hacı cavab verdi - Adsense ya görə VÖEN gəlir vergisi 20% istəyirlər (31 gün əvvəl)

Triste cavab verdi - Adsense ya görə VÖEN gəlir vergisi 20% istəyirlər (32 gün əvvəl)

E. Hacı cavab verdi - Adsense ya görə VÖEN gəlir vergisi 20% istəyirlər (33 gün əvvəl)

Triste cavab verdi - Adsense ya görə VÖEN gəlir vergisi 20% istəyirlər (33 gün əvvəl)

E. Hacı cavab verdi - Telefon almışam kamerasında ləkə var qaytarmaq istəyirəm, mağaza qaytarmır (33 gün əvvəl)

Software Developer cavab verdi - Rus dili yatırımı (33 gün əvvəl)

Cənab cavab verdi - Rus dili yatırımı (34 gün əvvəl)

Software Developer cavab verdi - Rus dili yatırımı (34 gün əvvəl)

Cənab cavab verdi - Rus dili yatırımı (34 gün əvvəl)

Software Developer cavab verdi - Rus dili yatırımı (35 gün əvvəl)

Software Developer - 615 xal

E. Hacı - 608 xal

Onar Alili - 526 xal

Dilsuz - 448 xal

Cabbarov Sübhan - 434 xal

Maqa - 346 xal

Ruslan Butdayev - 328 xal

Namiq Bəndəli - 297 xal

U.Tarlan - 244 xal

Meherremoff - 234 xal

Sistemə daxil olmuş 23307 sualdan 92%-dən çoxu cavablandırılmışdır.

Proyekt haqqında

E-Haci.net istehsalı. © 2010-2025