嘿所有我已经过这个不错的效果跑了3D图像hereCSS3 3D图像转换结合
问题是,我试图弄清楚如何将所有效果组合成一个页面,而不必为每个html页面效果设置(翻转,旋转,多重翻转,立方体,展开&其他)
能不能让我知道如何完成这项任务?它似乎为每个效果使用了不同的CSS样式,而我无法将style1-6.css合并到一个页面中,否则它会弄乱所有效果。
更新 我目前可以做到这一点:
$navNext.on('click', function(event) {
var randNum = Math.floor (Math.random() * wPerspective.length)
$type = wPerspective[randNum];
type = wPerspective[randNum];
$("LINK[href*='css/style1.css']").remove();
$("LINK[href*='css/style2.css']").remove();
$("LINK[href*='css/style3.css']").remove();
$("LINK[href*='css/style4.css']").remove();
$("LINK[href*='css/style5.css']").remove();
$("LINK[href*='css/style6.css']").remove();
var $$ = document;
var head = $$.getElementsByTagName('head')[0];
var link = $$.createElement('link');
link.id = 'myCss';
link.rel = 'stylesheet';
link.type = 'text/css';
link.media = 'all';
console.log(type + ' | ' + type.indexOf("te-flip"));
if (type.indexOf("te-flip") == 0)
{
link.href = 'css/style1.css';
}else if (type.indexOf("te-rotation") == 0)
{
link.href = 'css/style2.css';
}else if (type.indexOf("te-multiflip") == 0)
{
link.href = 'css/style3.css';
}else if (type.indexOf("te-cube") == 0)
{
link.href = 'css/style4.css';
}else if (type.indexOf("te-unfold") == 0)
{
link.href = 'css/style5.css';
}else if (type.indexOf("te-example") == 0)
{
link.href = 'css/style6.css';
}
head.appendChild(link);
$teTransition.addClass(type);
if(hasPerspective && animated)
return false;
animated = true;
showNext();
return false;
});
但它不是很流畅....
我的演示页http://june3rdsoftware.com/trans/index.html
你是什么意思结合起来? – ddlshack
@ddlshack:将所有效果放到一个页面中,而不是每个效果都是不同的html页面。 – StealthRT
在同一页上的不同图像上? – ddlshack