生日快乐的多种外语说法。
发布网友
发布时间:2022-04-27 07:17
我来回答
共7个回答
懂视网
时间:2022-04-23 08:14
这次给大家带来parabola.js实现抛物线与加入购物车功能,parabola.js实现抛物线与加入购物车功能的注意事项有哪些,下面就是实战案例,一起来看一下。
parabola.js
var funParabola = function (element, target, options) {
/*
* 网页模拟现实需要一个比例尺
* 如果按照1像素就是1米来算,显然不合适,因为页面动不动就几百像素
* 页面上,我们放两个物体,200~800像素之间,我们可以映射为现实世界的2米到8米,也就是100:1
* 不过,本方法没有对此有所体现,因此不必在意
*/
var defaults = {
speed: 166.67, // 每帧移动的像素大小,每帧(对于大部分显示屏)大约16~17毫秒
curvature: 0.001, // 实际指焦点到准线的距离,你可以抽象成曲率,这里模拟扔物体的抛物线,因此是开口向下的
progress: function () {
},
complete: function () {
}
};
var params = {};
options = options || {};
for (var key in defaults) {
params[key] = options[key] || defaults[key];
}
var exports = {
mark: function () {
return this;
},
position: function () {
return this;
},
move: function () {
return this;
},
init: function () {
return this;
}
};
/* 确定移动的方式
* IE6-IE8 是margin位移
* IE9+使用transform
*/
var moveStyle = "margin", testp = document.createElement("p");
if ("oninput" in testp) {
["", "ms", "webkit"].forEach(function (prefix) {
var transform = prefix + (prefix ? "T" : "t") + "ransform";
if (transform in testp.style) {
moveStyle = transform;
}
});
}
// 根据两点坐标以及曲率确定运动曲线函数(也就是确定a, b的值)
/* 公式: y = a*x*x + b*x + c;
*/
var a = params.curvature, b = 0, c = 0;
// 是否执行运动的标志量
var flagMove = true;
if (element && target && element.nodeType == 1 && target.nodeType == 1) {
var rectElement = {}, rectTarget = {};
// 移动元素的中心点位置,目标元素的中心点位置
var centerElement = {}, centerTarget = {};
// 目标元素的坐标位置
var coordElement = {}, coordTarget = {};
// 标注当前元素的坐标
exports.mark = function () {
if (flagMove == false) return this;
if (typeof coordElement.x == "undefined") this.position();
element.setAttribute("data-center", [coordElement.x, coordElement.y].join());
target.setAttribute("data-center", [coordTarget.x, coordTarget.y].join());
return this;
}
exports.position = function () {
if (flagMove == false) return this;
var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft,
scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
// 初始位置
if (moveStyle == "margin") {
element.style.marginLeft = element.style.marginTop = "0px";
} else {
element.style[moveStyle] = "translate(0, 0)";
}
// 四边缘的坐标
rectElement = element.getBoundingClientRect();
rectTarget = target.getBoundingClientRect();
// 移动元素的中心点坐标
centerElement = {
x: rectElement.left + (rectElement.right - rectElement.left) / 2 + scrollLeft,
y: rectElement.top + (rectElement.bottom - rectElement.top) / 2 + scrollTop
};
// 目标元素的中心点位置
centerTarget = {
x: rectTarget.left + (rectTarget.right - rectTarget.left) / 2 + scrollLeft,
y: rectTarget.top + (rectTarget.bottom - rectTarget.top) / 2 + scrollTop
};
// 转换成相对坐标位置
coordElement = {
x: 0,
y: 0
};
coordTarget = {
x: -1 * (centerElement.x - centerTarget.x),
y: -1 * (centerElement.y - centerTarget.y)
};
/*
* 因为经过(0, 0), 因此c = 0
* 于是:
* y = a * x*x + b*x;
* y1 = a * x1*x1 + b*x1;
* y2 = a * x2*x2 + b*x2;
* 利用第二个坐标:
* b = (y2+ a*x2*x2) / x2
*/
// 于是
b = (coordTarget.y - a * coordTarget.x * coordTarget.x) / coordTarget.x;
return this;
};
// 按照这个曲线运动
exports.move = function () {
// 如果曲线运动还没有结束,不再执行新的运动
if (flagMove == false) return this;
var startx = 0, rate = coordTarget.x > 0 ? 1 : -1;
var step = function () {
// 切线 y'=2ax+b
var tangent = 2 * a * startx + b; // = y / x
// y*y + x*x = speed
// (tangent * x)^2 + x*x = speed
// x = Math.sqr(speed / (tangent * tangent + 1));
startx = startx + rate * Math.sqrt(params.speed / (tangent * tangent + 1));
// 防止过界
if ((rate == 1 && startx > coordTarget.x) || (rate == -1 && startx < coordTarget.x)) {
startx = coordTarget.x;
}
var x = startx, y = a * x * x + b * x;
// 标记当前位置,这里有测试使用的嫌疑,实际使用可以将这一行注释
element.setAttribute("data-center", [Math.round(x), Math.round(y)].join());
// x, y目前是坐标,需要转换成定位的像素值
if (moveStyle == "margin") {
element.style.marginLeft = x + "px";
element.style.marginTop = y + "px";
} else {
element.style[moveStyle] = "translate(" + [x + "px", y + "px"].join() + ")";
}
if (startx !== coordTarget.x) {
params.progress(x, y);
window.requestAnimationFrame(step);
} else {
// 运动结束,回调执行
params.complete();
flagMove = true;
}
};
window.requestAnimationFrame(step);
flagMove = false;
return this;
};
// 初始化方法
exports.init = function () {
this.position().mark().move();
};
}
return exports;
};
实现
// body
<p class="container">
![](dist/01.png)
<center>点击加入购物车查看效果</center>
<!--动画图片-->
<p class="img-element" id="imgElement">
![](dist/02.jpg)
</p>
<!--购物车-->
<p class="shop-cart" id="shopCart"></p>
<span class="shop-cart-num">0</span>
<p class="add-shop-cart"><!--加入购物车--></p>
</p>
// script
// 起始位置元素
var imgElement = document.querySelector('#imgElement'),
// 终点位置元素
shopCartElement = document.querySelector('#shopCart'),
// 购物车数量
proNum = 0;
// 初始化抛物线动画
var myParabola = funParabola(imgElement, shopCartElement, {
speed: 100,// 每帧移动的像素大小
curvature: 0.005,// 实际指焦点到准线的距离
complete: function () {
imgElement.style.visibility = "hidden";
$('.shop-cart-num').text(++proNum);
}
});
// 绑定加入购物车事件
$('.add-shop-cart').click(function () {
// 重置位置
$('#imgElement').css({ left: '70px', bottom: '25px', visibility: 'visible' });
myParabola.position().move();
});
相信看了本文案例你已经掌握了方法,更多精彩请关注Gxl网其它相关文章!
推荐阅读:
JS设计模式之构造器模式详解
在Windows内安装Node.js报错怎么处理
热心网友
时间:2022-04-23 05:22
joyeux anniversaire 法语
с днем рождения 俄语
gelukkige verjaardag 荷兰语
alles Gute zum Geburtstag 德语
ευτυχή γενέθλια 希腊语
buon compleanno 意大利语
feliz aniversario 葡萄牙语
feliz cumpleaños 西班牙语
happy birthday 英语
诞生日おめでとう 日语
축 생일 韩语
生日快乐 中文
参考资料:http://fanyi.cn.yahoo.com/
热心网友
时间:2022-04-23 06:40
Afrikaans Veels geluk met jou verjaarsdag!
Albanian Urime ditelindjen!
Alsatian Gueter geburtsdaa!
Amharic Melkam lidet!
Arabic Eid milaad saeed! or Kul sana wa inta/i tayeb/a! (masculine/feminine)
Armenian Taredartzet shnorhavor! or Tsenund shnorhavor!
Assyrian Eida D'molakh Hawee Brikha!
Austrian-Viennese Ois guade winsch i dia zum Gbuadsdog!
Aymara (Bolivia) Suma Urupnaya Cchuru Uromankja!
Azerjani Ad gununuz mubarek! -- for people older than you
Ad gunun mubarek! -- for people younger than you
Basque Zorionak!
Belauan-Micronesian Ungil el cherellem!
Bengali (Bangladesh/India) Shuvo Jonmodin!
Bicol (Philippines) Maogmang Pagkamundag!
Bislama (Vanuatu) Hapi betde! or Yumi selebretem de blong bon blong yu!
Brazil Parab閚s a voc?
Parab閚s a voc?
nesta data querida muitas felicidades e muitos anos de vida.
Breton Deiz-ha-bloaz laouen deoc'h!
Bulgarian Chestit Rojden Den!
Cambodian Som owie nek mein aryouk yrinyu!
Catalan Per molts anys! or Bon aniversari! or Moltes Felicitats!
Chamorro Biba Kumplianos!
Chinese-Cantonese Sun Yat Fai Lok!
Chinese Fuzhou San Ni Kuai Lo!
Chiness-Hakka Sang Ngit Fai Lok!
Chinese-Mandarin qu ni sheng er kuai le
Chinese-Shanghaiese San ruit kua lok!
Chinese-Tiociu Se Jit khuai lak!
Chronia Polla NA ZHSHS
Croatian Sretan Rodendan!
Czech Vsechno nejlepsi k Tvym narozeninam!!
Danish Tillykke med fodselsdagen!
Dutch-Antwerps Ne gelukkege verjoardach!
Dutch-Bilzers Ne geleukkege verjoardoag!
Dutch-Drents Fellisiteert!
Dutch-Flemish Gelukkige verjaardag! or Prettige verjaardag!
Dutch-Frisian Fan herte lokwinske!
Dutch-Limburgs Proficiat! or Perfisia!
Dutch-Spouwers Ne geleukkege verjeurdoag!
Dutch-Twents Gefeliciteard met oen'n verjoardag!
Dutch Hartelijk gefeliciteerd! or Van harte gefeliciteerd met je verjaardag!
English Happy Birthday!
Esperanto Felichan Naskightagon!
Estonian Palju onne sunnipaevaks!
Euskera Zorionak zure urtebetetze egunean!
Faroes ( Faroe island ) Tillukku vid fodingardegnum!
Farsi Tavalodet Mobarak!
Finnish Hyvaa syntymapaivaa!
French (Canada) Bonne Fete!
French Joyeux Anniversaire!
Frisian Lokkiche jierdei!
Gaelic (Irish) L?breithe mhaith agat!
Gaelic (Scottish) Co` latha breith sona dhuibh!
Galician (Spain) Ledicia no teu cumpreanos!
Georgian Gilotcav dabadebis dges!
German-Badisch Allis Guedi zu dim Fescht!
German-Bavarian Ois Guade zu Deim Geburdstog!
German-Berlinisch Allet Jute ooch zum Jeburtstach! or Ick wuensch da allet Jute zum Jeburtstach!
German-Bernese Es Muentschi zum Geburri!
German-Camelottisch Ewllews Gewtew zewm Gewbewrtstewg. Mew!
German-Frankonian Allmecht! Iich wuensch Dir aan guuadn Gebuardsdooch!
German-Lichtenstein Haerzliche Glueckwuensche zum Geburtstag!
German-Moselfraenkisch Haezzlische Glickwunsch zem Gebordsdach!
German-Plattdeutsch Ick wuensch Di allns Gode ton Geburtsdach!
German-Rhoihessisch Ich gratelier Dir aach zum Geburtstag!
German-Ruhr Allet Gute zum Gebuatstach!
German-Saarlaendisch Alles Gudde for dei Gebordsdaach!
German-Saechsisch Herzlischen Gliggwunsch zum Geburdsdaach!
German-Schwaebisch Aelles Guade zom Gebordzdag!
German-Wienerisch Ois Guade zum Geburdsdog!
German Alles Gute zum Geburtstag!
Greek Eytyxismena Genethlia! or Chronia Pola!
Greenlandic Inuuinni pilluarit!
Gronings (Netherlands) Fielsteerd mit joen verjoardag!
Gujarati (India) Janma Divas Mubarak!
Gujrati (Pakistan) Saal Mubarak!
Guarani (Paraguay Indian)] Vy-Apave Nde Arambotyre!
Hawaiian Hau`oli la hanau!
Hebrew Yom Huledet Same'ach!
Hiligaynon (Philippines) Masadya gid nga adlaw sa imo pagkatawo!
Hindi (India) Janam Din ki badhai! or Janam Din ki shubkamnaayein!
Hungarian Boldog szuletesnapot! or Isten eltessen!
Icelandic Til hamingju med afmaelisdaginn!
Indonesian Selamat Ulang Tahun!
Irish-gaelic La-breithe mhaith agat! or Co` latha breith sona dhut! Or Breithla Shona Dhuit!
Italian Buon Compleanno!
Italian (Piedmont) Bun Cumpleani!
Italian (Romagna) At faz tent avguri ad bon cumplean!
Japanese Otanjou-bi Omedetou Gozaimasu!
Javaans-Indonesia Slamet Ulang Taunmoe!
Jerriais Bouon Anniversaithe!
Kannada (India) Huttida Habba Subashayagalu!
Kapangpangan (Philippines) Mayap a Ketan
Kashmiri (India) Voharvod Mubarak Chuy!
Kazakh (Kazakstan) Tughan kuninmen!
Klingon Quchjaj qoSlIj!
Korean Saeng il chuk ha ham ni da!
Kurdish Rojbun a te piroz be!
Kyrgyz Tulgan kunum menen!
Latin Fortuna dies natalis!
Latvian Daudz laimes dzimsanas diena!
Lithuanian Sveikinu su gimtadieniu! or Geriausi linkejimaigimtadienio progal
Luganda Nkwagaliza amazalibwa go amalungi!
Luxembourgeois Vill Gleck fir daei Geburtsdaag!
Macedonian Sreken roden den!
Malayalam (India) Pirannal Aasamsakal! or Janmadinasamsakal!
Malaysian Selamat Hari Jadi!
Maltese Nifrahlek ghal gheluq sninek!
Maori Kia huritau ki a koe!
Marathi (India) Wadhdiwasachya Shubhechha!
Mauritian Kreol mo swet u en bonlaniverser!
Mbula (Umboi Island, Papua New Guinea) Leleng am pa mbeng ku taipet i!
Mongolian Torson odriin mend hurgee!
Navajo bil hoozho bi'dizhchi-neeji' 'aneilkaah!
Niederdeutsch (North Germany) Ick gratuleer di scheun!
Nepali Janma dhin ko Subha kamana!
Norwegian Gratulerer med dagen!
Oriya (India) Janmadina Abhinandan!
Papiamento (lower Dutch Antilles) Masha Pabien I hopi aña mas!
Pashto (Afganistan) Padayish rawaz day unbaraksha!
Persian Tavalodet Mobarak!
Pinoy (Philippines) Maligayang kaarawan sa iyo!
Polish Wszystkiego Najlepszego! or Wszystkiego najlepszego zokazji urodzin!
wszystkiego najlepszego z okazji urodzin
Portuguese (Brazil) Parabens pelo seu aniversario! or Parabenspara voce! or Parabens e muitas felicidades!
Portuguese Feliz Aniversario! or Parabens!
Punjabi (India) Janam din diyan wadhayian!
Rajasthani (India) Janam ghaanth ri badhai, khoob jeeyo!
Romanian La Multi Ani!
Rosarino Basico (Argentina) Feneligiz Cunumplegeanagonos!
Russian S dniom razhdjenia! or Pazdravliayu s dniom razhdjenia!
Sami/Lappish Lihkos Riegadanbeaivvis!
Samoan Manuia lou aso fanau!
Sanskrit (India) Ravihi janmadinam aacharati!
Sardinian (Italy) Achent'annos! Achent'annos!
Schwyzeretsch (Swiss German) Vill Glück zum Geburri!
Serbian Srecan Rodjendan!
Slovak Vsetko najlepsie k narodeninam!
Slovene Vse najboljse za rojstni dan!
Sotho Masego motsatsing la psalo!
Spanish Feliz Cumplea駉s!
Sri Lankan Suba Upan dinayak vewa!
Sundanese Wilujeng Tepang Taun!
Surinamese Mi fresteri ju!
Swahili Hongera! or Heri ya Siku kuu!
Swedish Grattis p?f鰀elsedagen
Syriac Tahnyotho or brigo!
Tagalog (Philippines) Maligayang Bati Sa Iyong Kaarawan!
Taiwanese San leaz quiet lo!
Tamil (India) Piranda naal vaazhthukkal!
Telugu (India) Janmadina subha kankshalu!
Telugu Puttina Roju Shubakanksalu!
Thai Suk San Wan Keut!
Tibetan Droonkher Tashi Delek!
Tulu(Karnataka - India) Putudina dina saukhya!
Turkish Dogum gunun kutlu olsun!
Ukrainian Mnohiya lita! or Z dnem narodjennia!
Ur (India) Janam Din Mubarak
Ur (Pakistan) Saalgirah Mubarak!
Vietnamese Chuc Mung Sinh Nhat!
Visayan (Philippines) Malipayong adlaw nga natawhan!
Welsh Penblwydd Hapus i Chi!
Xhosa (South Afican) Imini emandi kuwe!
Yiddish A Freilekhn Gebortstog!
Yoruba (Nigeria) Eku Ojobi!
Zulu (South Afican) Ilanga elimndandi kuwe!
参考资料:http://www.shabbir.com/romance/bday.html
热心网友
时间:2022-04-23 08:15
have a nice birthday
happy birthday to you
be happy on your birthday
热心网友
时间:2022-04-23 10:06
Happy birthday to you!
Happy birthday!
热心网友
时间:2022-04-23 12:14
お诞生日おめでとうございます
Happy birthday
热心网友
时间:2022-04-23 14:39
Happy birthday