Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: skripto keitimas
Parašė Valuediz· 2008 Lie. 24 14:07:24
#1
kaip pakeist šitą skripta, kad veiktu ne su sąrašu<ul>, o su lentele?
reikalinga skripto dalis:
function initPage(){
var _gallery = "#tab1 .gallery-content";
var _leftArrow = "#tab1 .prev";
var _rightArrow = "#tab1 .next";
//var _step = 405;
var _duration = 1800;
var _liPadding = 34;
var _gWidth = $(_gallery).width() + _liPadding ;
var _liWidth = $(_gallery+" li").width() + _liPadding;
var _liSum = $(_gallery+" li").length * _liWidth;
var _margin = 0;
var f = 0;
_step = _gWidth;
$(_rightArrow).click(function(){
if (_liSum - _gWidth <= _margin + _step) {
if (f == 0) {
_margin = _liSum - _gWidth
f = 1;
} else {
_margin = 0;
f = 0
}
}
else _margin = _margin + _step;
$(_gallery+" ul").animate({marginLeft: -_margin+"px"}, {queue:false,duration:_duration });
return false;
});
$(_leftArrow).click(function(){
_margin = _margin - _step;
if (_margin < 0) _margin = 0;
$(_gallery + " ul").animate({
marginLeft: -_margin + "px"
{
queue:false, duration: _duration
});
return false;
});
Parašė ramon· 2008 Lie. 24 14:07:34
#2
function initPage(){
var _gallery = "#tab1 .gallery-content";
var _leftArrow = "#tab1 .prev";
var _rightArrow = "#tab1 .next";
//var _step = 405;
var _duration = 1800;
var _liPadding = 34;
var _gWidth = $(_gallery).width() + _liPadding ;
var _liWidth = $(_gallery+" li").width() + _liPadding;
var _liSum = $(_gallery+" li").length * _liWidth;
var _margin = 0;
var f = 0;
_step = _gWidth;
$(_rightArrow).click(function(){
if (_liSum - _gWidth <= _margin + _step) {
if (f == 0) {
_margin = _liSum - _gWidth
f = 1;
} else {
_margin = 0;
f = 0
}
}
else _margin = _margin + _step;
$(_gallery+" ul").animate({marginLeft: -_margin+"px"}, {queue:false,duration:_duration });
return false;
});
$(_leftArrow).click(function(){
_margin = _margin - _step;
if (_margin < 0) _margin = 0;
$(_gallery + " ul").animate({
marginLeft: -_margin + "px"
{
queue:false, duration: _duration
});
return false;
});
Parašė Valuediz· 2008 Lie. 24 14:07:50
#3
o <ul> keist i <table> ar i <tr>? :s
Parašė ramon· 2008 Lie. 24 14:07:02
#4
ul = tr
li = td
kodas visas i table
Parašė nem3sis· 2008 Lie. 24 14:07:44
#5
zmones kaip padaryti wietoi spalvoto bg i paveiksleli
Parašė ramon· 2008 Lie. 24 14:07:00
#6
nenemwiw kurk nauja tema geriqu ieskok forume, nes tu cia ne itema ilindai..
Parašė Valuediz· 2008 Lie. 24 14:07:28
#7
kažkaip nesuveike :| nejuda ir viskas
Idedu visa susijusi kodą:
Skriptas
function initPage(){
var _gallery = "#tab1 .gallery-content";
var _leftArrow = "#tab1 .prev";
var _rightArrow = "#tab1 .next";
//var _step = 405;
var _duration = 1800;
var _liPadding = 34;
var _gWidth = $(_gallery).width() + _liPadding ;
var _liWidth = $(_gallery+" td").width() + _liPadding;
var _liSum = $(_gallery+" td").length * _liWidth;
var _margin = 0;
var f = 0;
_step = _gWidth;
$(_rightArrow).click(function(){
if (_liSum - _gWidth <= _margin + _step) {
if (f == 0) {
_margin = _liSum - _gWidth
f = 1;
} else {
_margin = 0;
f = 0
}
}
else _margin = _margin + _step;
$(_gallery+" tr").animate({marginLeft: -_margin+"px"}, {queue:false,duration:_duration });
return false;
});
$(_leftArrow).click(function(){
_margin = _margin - _step;
if (_margin < 0) _margin = 0;
$(_gallery + " tr").animate({
marginLeft: -_margin + "px"
{
queue:false, duration: _duration
});
return false;
});
// for second tab
var _gallery2 = "#tab2 .gallery-content";
var _leftArrow2 = "#tab2 .prev";
var _rightArrow2 = "#tab2 .next";
//var _step = 405;
var _gWidth2 = $(_gallery2).width() + _liPadding ;
var _liWidth2 = $(_gallery2+" li").width() + _liPadding;
var _liSum2 = $(_gallery2+" li").length * _liWidth2;
var _margin2 = 0;
var f2 = 0;
var _step2 = _gWidth2;
$(_rightArrow2).click(function(){
if (_liSum2 - _gWidth2 <= _margin2 + _step2) {
if (f2 == 0) {
_margin2 = _liSum2 - _gWidth2
f2 = 1;
} else {
_margin2 = 0;
f2 = 0
}
}
else _margin2 = _margin2 + _step2;
$(_gallery2+" ul").animate({marginLeft: -_margin2+"px"}, {queue:false,duration:_duration });
return false;
});
$(_leftArrow2).click(function(){
_margin2 = _margin2 - _step2;
if (_margin2 < 0) _margin2 = 0;
$(_gallery2 + " ul").animate({
marginLeft: -_margin2 + "px"
}, {
queue:false, duration: _duration
});
return false;
});
}
if (window.addEventListener)
window.addEventListener("load", initPage, false);
else if (window.attachEvent)
window.attachEvent("onload", initPage);
tab2 nekeičiau nes kolkas nenaudosiu
html:
<div id="tab1" class="gallery" style="left: 0pt;">
<a class="prev" href="#">Previous</a>
<a class="next" href="#">Next</a>
<div class="gallery-content">
<table cellpadding="0" cellspacing="0" style="padding-top: 35px; width:875px;">
<tr>
<td width="200">
<a href="#">
<img src="img/01.jpg" class="reflex itiltnone" alt="pirmas šablonas" width="200px" height="120px" border="0">
</a>
</td>
<td width="200" style="padding-left: 25px;">
<a href="#">
<img src="img/01.jpg" class="reflex itiltnone" alt="antras šablonas" width="200px" height="120px" border="0">
</a>
</td>
<td width="200" style="padding-left: 25px;">
<a href="#">
<img src="img/01.jpg" class="reflex itiltnone" alt="antras šablonas" width="200px" height="120px" border="0">
</a>
</td>
</tr>
</table>
</div>
Gal taip kur klaida įsivėlė?
Redagavo Valuediz· 2008 Lie. 24 15:07:20
Parašė Valuediz· 2008 Lie. 24 19:07:21
#8
na kur expertai? :s