| Autor | Zpráva | ||
|---|---|---|---|
| golop Profil |
#1 · Zasláno: 28. 8. 2011, 21:26:30
Potreboval bych neco jak je na tomto webu http://salacuse.com/ jen ja tam budu mit v levo menu http://golop.cz/test/ nemam tuseni jak to udelat prez divy, diky za pomoc.
|
||
| peta Profil |
#2 · Zasláno: 29. 8. 2011, 10:10:56 · Upravil/a: peta
? Nevim, jestli mas FF6, ale na prvni strance je pouze blok siroky asi 10.000 px plny obrazku. Netusim, co tam vidis ty.
google = javascript image slider http://axpsu.fpf.slu.cz/~web/vita/vita_rol2.htm http://axpsu.fpf.slu.cz/~web/vita/vita_rol.htm http://plugins.jquery.com/project/AnimEasing Nebo, jestli si dokazes ten js kod dat dohromady pro tvuj pripad, tak jsem pouzil kdysi neco takoveho. Ale je to mix trochu s pythonem. url = 'http://www2.fpf.slu.cz/'
url = 'http://plone.opf.slu.cz:9980/su/fpf/'
img = context.py_getGalString(a=a)
text = ''
if (len(img)>0):
text = '''
<table><tr>
<td><span onclick="slider.slide([+1,0]);" class="button left"><span><</span></span></td>
<td><div id="gal"><div class="panel"></div></div></td>
<td><span onclick="slider.slide([-1,0])" class="button right"><span>></span></span></td>
</tr></table>
'''
code = """
function sortRnd(a,b)
{
return 0.66 - Math.random(); // 0.5 - Math.random(); 0.66 best sort
}
function slider_init()
{
var gal, pan, img, image_list, data, i;
gal = $('#gal');
pan = $('#gal .panel');
image_list = '"""+ img +"""';
i = image_list.length;
if (i>0 && image_list.substring(i-1)==';') // odstran posledni strednik
{
image_list = image_list.substring(0,i-1);
}
image_list = image_list.split(';');
image_list.sort(sortRnd);
for (i=0;i<image_list.length;i++)
{
data = image_list[i].split(',');
pan.append($('<div/>')
.addClass("item")
.append($('<img/>')
.attr('src',data[1])
.attr('alt',data[0])
.attr('width',200)
.attr('height',148)
)
);
}
img = $('#gal .panel img');
pan.css('width',img.width()*image_list.length);
slider =
{
'effect' : 'expoout',
'border' : [-(pan.width()-gal.width()),-(pan.height()-gal.height()),0,0],
'position': [0,0],
'step' : [img.width(),img.height()],
'speed' : 1000,
'slide' : function (orientation)
{
var s,p,b,bool;
s = this.step;
p = this.position;
b = this.border;
p[0] = p[0] + orientation[0] * s[0];
p[1] = p[1] + orientation[1] * s[1];
bool = [
p[0]<b[0],
p[0]>b[2],
p[1]<b[1],
p[1]>b[3]
];
p[0] = bool[0] ? b[0] : p[0];
p[0] = bool[1] ? b[2] : p[0];
p[1] = bool[2] ? b[1] : p[1];
p[1] = bool[3] ? b[3] : p[1];
$('#gal .panel').animate({ left: p[0], top: p[1]},{'duration':this.speed,'easing':this.effect});
this.position = p;
}
}
}
var slider;
slider_init();
"""
text = text + tagScript(url+'jquery-1.5.min.js','');
text = text + tagScript(url+'jquery.easing.1.3.js','');
text = text + tagScript(url+'jquery.easing.compatibility.js','');
text = text + tagScript('',code);
return text;
else:
return "";google = javascript jquery animate easing http://s3.amazonaws.com/buildinternet/live-tutorials/panning-slideshow/panning-slideshow.htm http://tobia.github.com/CrossSlide/ http://www.w3schools.com/jquery/jquery_effects.asp Pripadne forum javascript. Nebo googlem si najit neco o tagu Marquee http://peter-mlich.wz.cz/web/js/prjpw/animace_simple.html Nebo chces skutecne jeden velky pas? A vedle neho menu? Zkus css position:fixed. Pokud to tvuj prohlizec nepodporuje, zkus to javascriptem, http://peter-mlich.wz.cz/web/js/prjpw/fixed-object.html . |
||
|
Časová prodleva: 15 let
|
|||
0