πŸ”” Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

A simple 3D carousel widget. It supports all major browsers including IE8,9 with best effort. Full 3D effect requires css transform3d support browsers. And this widget works with not only images but any html elements as child.

Carousel Plugins

Documentation

carousel-3d : jquery plugin 3D carousel slider

A simple 3D carousel widget. It supports all major browsers including IE8,9 with best effort. Full 3D effect requires css transform3d support browsers. And this widget works with not only images but any html elements as child.

Supports

  • IE8~ (full 3D requires IE10~)
  • Chrome(32~)
  • Safari(6~)
  • Firefox(9~)
  • Opera(?~)
  • iOS-Safari(ios5~)
  • android-browser(?~)

Thanks to Sauce Labs, I confirmed carousel working on above versions. I think I can say it works almost everywhere.

Demo

http://paio-co-kr.github.io/carousel-3d

demo image

Installation

bower install carousel-3d

Dependencies

carousel-3d requires some modules. jquery, javascript-detect-element-resize, modernizr, waitForImages. You will need to include those scripts before carousel-3d.js in html page or load it with requirejs or browserify as carousel-3d comes with UMD style module definition.

Code Example

  • Extremely Easy! you don't need to code javascript.
  • Adding data-carousel-3d attribute on div will be rendered as carousel.
  • Create items in the <div data-carousel-3d></div> tag. All items on that list will be arranged on 3D position.
  • Items can be simple image or any complicated html elements.
  • You can also selected attribute on item which will be default selected item.

in header, add css theme and required js.

<link rel="stylesheet" href="../dist/styles/jquery.carousel-3d.default.css" />  <script src="../bower_components/jquery/jquery.js"></script> <script src="../bower_components/javascript-detect-element-resize/jquery.resize.js"></script> <script src="../bower_components/waitForImages/dist/jquery.waitforimages.js"></script> <script src="../bower_components/modernizr/modernizr.js"></script> <script src="../dist/jquery.carousel-3d.js" ></script>

in body

<div id="wrapper">     <div id="myCarousel" data-carousel-3d>         <img src="./images/1.jpg" />         <img src="./images/2.jpg" selected />         <img src="./images/3.jpg" />         <img src="./images/4.jpg" />         <img src="./images/5.jpg" />     </div> </div>
  • You will also want html document as child. wrap contents with a div.
<div style="min-width: 640px; min-height: 420px; max-width: 640px; max-height: 420px;">     <p style="background-color:black; color:white; margin:20px; padding:20px;">A simple html child</p>     <div style="background-color:gray; color:white;">Html contents also works ok!!!</div>     <div>The quick brown fox jumps over the lazy dog</div>     <p>         Make the fox         <button type="button" onclick="alert('Jump!!');">jump</button>     </p> </div>

The Carousel will have parents 100% width & aspect height. so you will want wrap the div with appropriate size. And wide aspect(3:2, 2:1 ...) is recommanded for 3D rotating effect.

You can have multiple carousels with no effort. Just set proper attribues.

API Reference

  • Rotate carousel prev / next
$('#myCarousel').Carousel3d('prev'); $('#myCarousel').Carousel3d('next');
  • Rotate carousel by index
$('#myCarousel').Carousel3d('rotate', 3);
  • Event listener
$('#myCarousel').on('select', function (evt, index) {     console.log('item selected : ' + index); });

History

0.2.2

  • removed semi-NSFW image.
  • removed wrong js include in example html.

0.2.1

  • bug fix : Multiple instances #4

0.2.0

  • re-engineer project

0.1.0

  • improved transforms
  • added theme feature

License

MIT Β© PAIO

μΌ€λŸ¬μ…€-3d : 제이쿼리 ν”ŒλŸ¬κ·ΈμΈ 3D μΌ€λŸ¬μ…€ μŠ¬λΌμ΄λ”

정말 κ°„λ‹¨ν•œ 3d μΌ€λŸ¬μ…€ μœ„μ ―μž…λ‹ˆλ‹€.
css transform3d와 같이 Full 3d 효과λ₯Ό μš”κ΅¬ν•˜λŠ” λΈŒλΌμš°μ €λ“€μ„ μ§€μ›ν•˜λŠ” 것은 λ¬Όλ‘  IE8,9 μ—μ„œλ„ 졜적의 μ„±λŠ₯을 보이도둝 μ§€μ›ν•©λ‹ˆλ‹€. λ˜ν•œ κ·Έλ¦Όλ“€ 뿐만 μ•„λ‹ˆλΌ μ–΄λ– ν•œ HTML elements 의 μžμ‹μš”μ†Œμ—μ„œλ„ 잘 μž‘λ™ν•©λ‹ˆλ‹€.

지원

  • 인터넷 μ΅μŠ€ν”Œλ‘œλŸ¬ 8 ~ (Full 3dλ₯Ό μš”κ΅¬ν•˜λŠ” IE10~이상)
  • 크둬(32~)
  • μ‚¬νŒŒλ¦¬(6~)
  • νŒŒμ΄μ–΄ν­μŠ€(9~)
  • 였페라(?~)
  • iOS μ‚¬νŒŒλ¦¬(ios5~)
  • μ•ˆλ“œλ‘œμ΄λ“œ λΈŒλΌμš°μ €(?~)

λ¨Όμ € 도움을 μ£Όμ‹  Sauce Labs에 κ°μ‚¬μ˜ 말씀을 μ „ν•΄λ“œλ¦¬λ©°, μ•žμ„œ μ–ΈκΈ‰λœ μΈν„°λ„·λΈŒλΌμš°μ €λ“€μ˜ λ²„μ „μ—μ„œ μΌ€λŸ¬μ…€-3Dκ°€ 잘 μž‘λ™ν•˜λŠ” 것이 확인 λ˜μ—ˆμŠ΅λ‹ˆλ‹€. 제 μƒκ°μ—λŠ” 거의 λͺ¨λ“  κ³³μ—μ„œ 잘 μž‘λ™ν•œλ‹€κ³  ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

데λͺ¨

http://paio-co-kr.github.io/carousel-3d

demo image

μ„€μΉ˜

bower install carousel-3d

μ˜μ‘΄μ„±

μΌ€λŸ¬μ…€-3dλŠ” jquery, javascript-detect-element-resize, modernizr, waitForImagesλ“± κ³Ό 같은 λͺ¨λ“ˆλ“€μ˜ 도움이 ν•„μš”ν•©λ‹ˆλ‹€. μ—¬λŸ¬λΆ„λ“€μ΄ μΌ€λŸ¬μ…€-3d.jsλ₯Ό HTMLνŽ˜μ΄μ§€ μ•ˆμ—μ„œ κ΅¬ν˜„ ν•˜κ±°λ‚˜ λ˜λŠ” ν•„μš”ν•œ μžλ°”μŠ€ν¬λ¦½νŠΈμ™€ ν•¨κ»˜ μ‹€μ–΄ κ΅¬ν˜„ν•˜κ±°λ‚˜, λ˜λŠ” UMD μŠ€νƒ€μΌ λͺ¨λ“ˆ μ •μ˜μ— λ”°λ₯Έ μΌ€λŸ¬μ…€-3dλ₯Ό κ΅¬ν˜„ν•˜κ³  μ‹Άλ‹€λ©΄ μ•žμ„œ μ–ΈκΈ‰ν•œ μŠ€ν¬λ¦½νŠΈλ“€μ΄ ν•„μš” ν•  κ²ƒμž…λ‹ˆλ‹€.

μ½”λ“œ μ˜ˆμ‹œ

  • 정말 μ‰¬μ›Œμš”! μžλ°”μŠ€ν¬λ¦½νŠΈ μ½”λ“œλ₯Ό λͺ°λΌλ„ λ©λ‹ˆλ‹€.
  • div의 data-carousel-3d속성에 μΆ”κ°€ν•˜μ„Έμš”. μΌ€λŸ¬μ…€λ‘œ 되돌렀질 κ²ƒμž…λ‹ˆλ‹€.
  • <div data-carousel-3d></div> νƒœκ·Έμ•ˆμ— μ•„μ΄ν…œλ“€μ„ λ§Œλ“œμ„Έμš”. κ·Έ 리슀트의 μ•„μ΄ν…œλ“€μ΄ λͺ¨λ‘ 3D μœ„μΉ˜λ‘œ μž‘ν˜€μ§ˆ κ²ƒμž…λ‹ˆλ‹€.
  • κ·Έλ¦Όμ΄λ‚˜ μ–΄λ–€ λ³΅μž‘ν•œ HTML elements μ•„μ΄ν…œλ“€λ„ 간단 ν•΄μ§‘λ‹ˆλ‹€.
  • selected속성을 μ΄μš©ν•˜μ—¬ κΈ°λ³Έμ„ νƒμœΌλ‘œ 된 μ•„μ΄ν…œμœΌλ‘œλ„ 적용 ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

css ν…Œλ§ˆ λ˜λŠ” ν•„μš”ν•œ μžλ°”μŠ€ν¬λ¦½νŠΈμ˜ 헀더 μ•ˆμ— μΆ”κ°€ ν•˜μ„Έμš”.

<link rel="stylesheet" href="../dist/styles/jquery.carousel-3d.default.css" />  <script src="../bower_components/jquery/jquery.js"></script> <script src="../bower_components/javascript-detect-element-resize/jquery.resize.js"></script> <script src="../bower_components/waitForImages/dist/jquery.waitforimages.js"></script> <script src="../bower_components/modernizr/modernizr.js"></script> <script src="../dist/jquery.carousel-3d.js" ></script>

body νƒœκ·Έ μ•ˆμ—

<div id="wrapper">     <div id="myCarousel" data-carousel-3d>         <img src="./images/1.jpg" />         <img src="./images/2.jpg" selected />         <img src="./images/3.jpg" />         <img src="./images/4.jpg" />         <img src="./images/5.jpg" />     </div> </div>
  • HTMLλ¬Έμ„œμ˜ μžμ‹μš”μ†Œκ°€ ν•„μš”ν• λ• div와 ν•¨κ»˜ 컨텐츠λ₯Ό 감싸 μ£Όμ„Έμš”.
<div style="min-width: 640px; min-height: 420px; max-width: 640px; max-height: 420px;">     <p style="background-color:black; color:white; margin:20px; padding:20px;">A simple html child</p>     <div style="background-color:gray; color:white;">Html contents also works ok!!!</div>     <div>The quick brown fox jumps over the lazy dog</div>     <p>         Make the fox         <button type="button" onclick="alert('Jump!!');">jump</button>     </p> </div>

μΌ€λŸ¬μ…€μ€ 100% width & aspect height λ₯Ό λΆ€λͺ¨μš”μ†Œλ‘œ κ°€μ§‘λ‹ˆλ‹€. κ·Έλž˜μ„œ divλ₯Ό μ λ‹Ήν•œ 크기둜 κ°μŒ€ ν•„μš”κ°€ μžˆμŠ΅λ‹ˆλ‹€. 그리고 3d μ„ νšŒ νš¨κ³ΌλŠ” wide aspect(3:2, 2:1 ...)정도λ₯Ό μΆ”μ²œλ“œλ¦½λ‹ˆλ‹€.

Multiple Carousels을 κ΅¬ν˜„ν•˜κ³  μ‹Άλ‹€λ©΄ κ°„λ‹¨ν•˜κ²Œ proper attribuesλ₯Ό μ„€μ •ν•΄ μ£ΌλŠ” κ²ƒλ§ŒμœΌλ‘œ μ—¬λŸ¬λΆ„μ΄ μ›ν•˜λŠ” λŒ€λ‘œ μ‰½κ²Œ κ΅¬ν˜„ ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

API μ°Έμ‘°

  • prev / next μΌ€λŸ¬μ…€ μˆœν™˜
$('#myCarousel').Carousel3d('prev'); $('#myCarousel').Carousel3d('next');
  • index 에 μ˜ν•œ μΌ€λŸ¬μ…€ μˆœν™˜
$('#myCarousel').Carousel3d('rotate', 3);
  • 이벀트 λ¦¬μŠ€λ„ˆ
$('#myCarousel').on('select', function (evt, index) {     console.log('item selected : ' + index); });

νžˆμŠ€ν† λ¦¬

0.2.2

  • semi-NSFW image μ‚­μ œλ¨.
  • 예제 html μ—μ„œ 잘λͺ»λœ js μ½”λ“œ μ‚­μ œλ¨.

0.2.1

  • 버그 μˆ˜μ • : Multiple instances #4

0.2.0

  • Re-μ—”μ§€λ‹ˆμ–΄ ν”„λ‘œμ νŠΈ

0.1.0

  • λ³€ν™”(λ³€ν˜•) ν–₯상됨
  • ν…Œλ§ˆ νŠΉμ§• 좔가됨

λΌμ΄μ„ΌμŠ€

MIT Β© PAIO


You May Also Like