in English

ካሮሰል

ብባእታታት-ስእልታት ወይ ስላይድ ጽሑፍ-ከም ካሮሰል ዝኣመሰለ ብሽክለታ ንምዝዋር ዝሕግዝ ስላይድ ሾው ባእታ።

ከመይ ይሰርሕ

እቲ ካሮሰል ብተኸታታሊ ትሕዝቶታት ብሽክለታ ንምጉዓዝ ዝሕግዝ ስላይድ ሾው ኮይኑ፡ ብCSS 3D ትራንስፎርምን ቁሩብ ጃቫስክሪፕትን ዝተሃንጸ እዩ። ብተኸታታሊ ምስልታት፡ ጽሑፍ ወይ ብሕታዊ ምልክት ይሰርሕ። ብተወሳኺ ንዝሓለፉ/ዝቕፅሉ ቁፅፅራትን መርኣይታትን ዝግበር ደገፍ እውን የጠቓልል።

ኣብቶም ገጽ ርኡይነት ኤፒኣይ ዝድገፈሎም ዳህሰስቲ ፡ እቲ መርበብ ሓበሬታ ንተጠቃሚ ኣብ ዘይርኣየሉ እዋን (ከም ትብ መርበብ ሓበሬታ ዘይንጡፍ ምስ ዝኸውን፡ መስኮት መርበብ ሓበሬታ ክጎድል ከሎ ወዘተ)፡ እቲ ካሮሰል ካብ ምዝንባል ክቑጠብ እዩ።

ናይዚ ኣካል ተንቀሳቓሲ ውጽኢት ኣብቲ ናይ prefers-reduced-motionሚድያ ሕቶ ዝምርኮስ እዩ። ኣብቲ ናይ ተበጻሕነት ሰነድና ኣብቲ ዝተቐነሰ ምንቅስቓስ ዝብል ክፍሊ ርአ ።

በጃኹም ኣስተውዕሉ፡ ዝተሰቕሉ ካሮሰልታት ከምዘይድገፉ፡ ከምኡ’ውን ካሮሰላት ብሓፈሻ ምስ ደረጃታት ተበጻሕነት ከምዘይሰማምዑ።

ኣብ መወዳእታ ፡ ጃቫስክሪፕትናutil.js ካብ ምንጪ ትሃንጽ እንተኾንካ ፡ .

ኣብነት

ካሮሰል ንኣውቶማቲክ ንመዐቀኒታት ስላይድ ንቡር ኣይገብርዎን እዮም። ከምኡ ስለዝኾነ፡ ትሕዝቶ ብግቡእ ንምዕባይ ተወሳኺ ዩቲሊቲታት ወይ ብሕታዊ ቅዲታት ክትጥቀም ከድልየካ ይኽእል እዩ። ካሮሰላት ንዝሓለፉ/ዝቕጽል ቁጽጽርን መርኣይታትን ክድግፉ እንከለዉ፡ ብግልጺ ግን ኣየድልዩን እዮም። ከምቲ ዝደለኻዮ ወስኸሉን ኣመዓራርዮን።

እቲ .activeክፍሊ ኣብ ሓደ ካብቶም ስላይድ ክውሰኽ ኣለዎ እንተዘይኮይኑ እቲ ካሮሰል ኣይክረአን እዩ። ከምኡ ውን ኣብቲ ንኣማራጺ ቁጽጽር ዝኸውን ፍሉይ id ምቕማጥካ ኣረጋግጽ .carousel፣ ብፍላይ ኣብ ሓደ ገጽ ብዙሓት ካሮሰል ትጥቀም እንተኾንካ። ቁጽጽርን መርኣዪን ባእታታት ምስ id ናይቲ ባእታ ዝሰማማዕ data-targetባህሪ (ወይ ንመላግቦታት) ክህልዎም ኣለዎ።href.carousel

ስላይድ ጥራይ

ኣብዚ ስላይድ ጥራይ ዘለዎ ካሮሰል ኣሎ። ንናይ መርበብ ሓበሬታ ነባሪ ምስሊ ኣሰላልፋ ንምክልኻል ህላወ ናይቲን ኣብ ካሮሰል ምስልታትን ኣስተውዕል .d-block.w-100

<div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
  <div class="carousel-inner">
    <div class="carousel-item active">
        <img src="..." class="d-block w-100" alt="...">
    </div>
    <div class="carousel-item">
      <img src="..." class="d-block w-100" alt="...">
    </div>
    <div class="carousel-item">
      <img src="..." class="d-block w-100" alt="...">
    </div>
  </div>
</div>

ምስ ቁጽጽር

ኣብ ዝሓለፈን ዝቕጽልን ቁጽጽር ምውሳኽ፤

<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
  <div class="carousel-inner">
    <div class="carousel-item active">
      <img src="..." class="d-block w-100" alt="...">
    </div>
    <div class="carousel-item">
      <img src="..." class="d-block w-100" alt="...">
    </div>
    <div class="carousel-item">
      <img src="..." class="d-block w-100" alt="...">
    </div>
  </div>
  <a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>

ምስ መርኣይታት

ብተወሳኺ ነቶም መርኣይታት ኣብቲ ካሮሰል ክትውስኾም ትኽእል ኢኻ፣ ጎኒ ጎኒ እቶም መቆጻጸሪታት፣ እውን።

<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
  <ol class="carousel-indicators">
    <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
    <li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
    <li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
  </ol>
  <div class="carousel-inner">
    <div class="carousel-item active">
      <img src="..." class="d-block w-100" alt="...">
    </div>
    <div class="carousel-item">
      <img src="..." class="d-block w-100" alt="...">
    </div>
    <div class="carousel-item">
      <img src="..." class="d-block w-100" alt="...">
    </div>
  </div>
  <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>

ምስ መግለጺ ጽሑፍ

ኣብ ስላይድካ ብቐሊሉ መግለጺታት ወስኸሉ ምስቲ .carousel-captionባእታ ኣብ ውሽጢ ዝኾነ .carousel-item. ኣብ ንኣሽቱ ቪውፖርት ብቐሊሉ ክሕባኡ ይኽእሉ፣ ከምቲ ኣብ ታሕቲ ዘሎ፣ ብኣማራጺ ናይ ምርኢት መገልገሊታት . ኣብ መጀመርታ ምስ ንሕብኦምን .d-noneኣብ ማእከላይ መሳርሒታት ብ .d-md-block.

<div id="carouselExampleCaptions" class="carousel slide" data-ride="carousel">
  <ol class="carousel-indicators">
    <li data-target="#carouselExampleCaptions" data-slide-to="0" class="active"></li>
    <li data-target="#carouselExampleCaptions" data-slide-to="1"></li>
    <li data-target="#carouselExampleCaptions" data-slide-to="2"></li>
  </ol>
  <div class="carousel-inner">
    <div class="carousel-item active">
      <img src="..." class="d-block w-100" alt="...">
      <div class="carousel-caption d-none d-md-block">
        <h5>First slide label</h5>
        <p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
      </div>
    </div>
    <div class="carousel-item">
      <img src="..." class="d-block w-100" alt="...">
      <div class="carousel-caption d-none d-md-block">
        <h5>Second slide label</h5>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
      </div>
    </div>
    <div class="carousel-item">
      <img src="..." class="d-block w-100" alt="...">
      <div class="carousel-caption d-none d-md-block">
        <h5>Third slide label</h5>
        <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
      </div>
    </div>
  </div>
  <a class="carousel-control-prev" href="#carouselExampleCaptions" role="button" data-slide="prev">
    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="carousel-control-next" href="#carouselExampleCaptions" role="button" data-slide="next">
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>

መስቀላዊ መልክዕ

.carousel-fadeስላይድ ኣብ ክንዲ ስላይድ ብናይ ምድምሳስ ምስግጋር ህይወት ንምሃብ ኣብ ካሮሰልካ ወስኸሉ ።

<div id="carouselExampleFade" class="carousel slide carousel-fade" data-ride="carousel">
  <div class="carousel-inner">
    <div class="carousel-item active">
      <img src="..." class="d-block w-100" alt="...">
    </div>
    <div class="carousel-item">
      <img src="..." class="d-block w-100" alt="...">
    </div>
    <div class="carousel-item">
      <img src="..." class="d-block w-100" alt="...">
    </div>
  </div>
  <a class="carousel-control-prev" href="#carouselExampleFade" role="button" data-slide="prev">
    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="carousel-control-next" href="#carouselExampleFade" role="button" data-slide="next">
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>

ኣብ መንጎ ብኣውቶማቲክ ብሽክለታ ናብቲ ዝቕጽል ኣቕሓ ምዝዋር ዘሎ መጠን ምድንጓይ ንምቕያር data-interval=""ናብ a ወስኽ ።.carousel-item

<div id="carouselExampleInterval" class="carousel slide" data-ride="carousel">
  <div class="carousel-inner">
    <div class="carousel-item active" data-interval="10000">
      <img src="..." class="d-block w-100" alt="...">
    </div>
    <div class="carousel-item" data-interval="2000">
      <img src="..." class="d-block w-100" alt="...">
    </div>
    <div class="carousel-item">
      <img src="..." class="d-block w-100" alt="...">
    </div>
  </div>
  <a class="carousel-control-prev" href="#carouselExampleInterval" role="button" data-slide="prev">
    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="carousel-control-next" href="#carouselExampleInterval" role="button" data-slide="next">
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>

ኣጠቓቕማ

ብመንገዲ ባህርያት ዳታ

ንኣቀማምጣ ናይቲ ካሮሰል ብቐሊሉ ንምቁጽጻር ናይ ዳታ ባህርያት ተጠቐም። ነቶም ቁልፊ ቃላት ወይ ፣ data-slideይቕበል ፣ እዚ ድማ ነቲ ናይ ስላይድ ቦታ ብተዛማዲ ምስቲ ሕጂ ዘለዎ ቦታ ይቕይሮ። ከም ኣማራጺ ፡ ጥረ ስላይድ ኢንዴክስ ናብቲ ካሮሰል ንምሕላፍ ተጠቐም ፣ እዚ ድማ ነቲ ስላይድ ቦታ ናብ ፍሉይ ኢንዴክስ ብ ዝጅምር የሰጋግሮ ።prevnextdata-slide-todata-slide-to="2"0

እቲ data-ride="carousel"ባህሪ ንሓደ ካሮሰል ካብ ጽዕነት ገጽ ጀሚሩ ከም ተንቀሳቓሲ ምልክት ንምግባር ይጥቀመሉ። ካሮሰልካ ንምጅማር እንተዘይተጠቒምካሉ data-ride="carousel"ባዕልኻ ክትጅምሮ ኣለካ። ምስ (ተደራራቢን ዘየድልን) ግሉጽ ምጅማር ጃቫስክሪፕት ናይ ሓደ ዓይነት ካሮሰል ተደሚሩ ክጥቀመሉ ኣይክእልን።

ብመንገዲ ጃቫስክሪፕት።

ንካሮሰል ​​ብኢድካ ብ፤

$('.carousel').carousel()

ኣማራጺታት

ኣማራጺታት ብመንገዲ ዳታ ​​ባህርያት ወይ ጃቫስክሪፕት ክሓልፉ ይኽእሉ። ንባህርያት ዳታ፡ ስም ኣማራጺ ናብ ምውሳኽ data-፡ ከምቲ ኣብ data-interval="".

ሽም ዓይነት ትሑዝ መግለፂ
ፍልልይ ቑጽሪ 5000 ይኸውን ኣብ መንጎ ብኣውቶማቲክ ንሓደ ኣቕሓ ብሽክለታ ምዝዋር ዘሎ መጠን ግዜ ምድንጓይ። ሓሶት እንተኾይኑ ካሮሰል ብኣውቶማቲክ ዑደት ኣይገብርን እዩ።
ቁልፊ ሰሌዳ ቡልያን ዝብል እዩ። ሓቂ እቲ ካሮሰል ንፍጻመታት ቁልፊ ሰሌዳ ግብረ መልሲ ክህብ ኣለዎ ድዩ የብሉን።
ጠጠው ምባል ሕብረ ቃላት | ቡልያን ዝብል እዩ። "ሆቨር" ዝብል እዩ።

ናብ , እንተተቐሚጡ "hover"፡ ንብሽክለታ ናይቲ ካሮሰል ኣብ ’ ዩ ደው የብሎ mouseenterእሞ፡ ንብሽክለታ ናይቲ ካሮሰል ኣብ mouseleave. ናብ ፡ እንተተቐሚጡ false፡ ኣብ ልዕሊ እቲ ካሮሰል ምዝንባል ደው ኣየብሎን እዩ።

ኣብ ምትንኻፍ ዝኽእል መሳርሒታት፡ ናብ ፡ ምስ ዝቕየር፡ ምዝዋር ብሽክለታ ንኽልተ ፍልልይ "hover"ደው ክብል እዩ (ተጠቃሚ ምስቲ ካሮሰል ምትእስሳር ምስ ወድአ)፡ ቅድሚ ብኣውቶማቲክ ዳግማይ ምጅማሩ። touchendእዚ ኣብ ርእሲ እዚ ኣብ ላዕሊ ዝተጠቕሰ ባህሪ ማውስ ምዃኑ ኣስተውዕል።

ጋልብ ገመድ ሓሶት ተጠቃሚ ነቲ ቀዳማይ ኣቕሓ ብኢዱ ድሕሪ ምዝዋሩ ነቲ ካሮሰል ብኣውቶማቲክ ይጻወቶ። "ካሮሰል" እንተኾይኑ፡ ነቲ ካሮሰል ኣብ ጽዕነት ብኣውቶማቲክ ይጻወቶ።
ጠቕለለ ቡልያን ዝብል እዩ። ሓቂ እቲ ካሮሰል ብቐጻሊ ብሽክለታ ክዝውር ኣለዎ ድዩ ወይስ ተሪር ደውታ ክህልዎ ኣለዎ።
ምንካእ ቡልያን ዝብል እዩ። ሓቂ እቲ ካሮሰል ኣብ መሳርሒታት ተንከስካሲ ስክሪን ንጸጋማይ/የማናይ ስዋይፕ ምትእስሳር ክድግፍ ኣለዎ ድዩ የብሉን።

ኣገባባት

ዘይተመዓራረዩ ኣገባባትን ምስግጋራትን።

ኩሎም ናይ ኤፒኣይ ሜላታት ዘይተመዓራረዩ ኮይኖም ምስግጋር ይጅምሩ ። እቲ ምስግጋር ምስ ተጀመረ ግን ከኣ ቅድሚ ምውድኡ ናብቲ ደዋሊ ይምለሱ ። ብተወሳኺ፡ ኣብ ሓደ መሰጋገሪ ኣካል ዝግበር ናይ ሜላ ጻውዒት ዕሽሽ ክበሃል እዩ .

ንዝያዳ ሓበሬታ ኣብ ሰነድ ጃቫስክሪፕትና ርአ

.carousel(options)

ነቲ ካሮሰል ብኣማራጺ ኣማራጺታት የበግሶን objectብመንገዲ ኣቑሑት ብሽክለታ ይጅምርን።

$('.carousel').carousel({
  interval: 2000
})

.carousel('cycle')

ካብ ጸጋም ናብ የማን ብመንገዲ እቶም ናይ ካሮሰል ኣቑሑት ዑደት ይገብር።

.carousel('pause')

ነቲ ካሮሰል ብኣቑሑት ኣቢሉ ካብ ብሽክለታ ከይዝውር ደው የብሎ።

.carousel(number)

ነቲ ካሮሰል ናብ ሓደ ፍሉይ ፍሬም ይዘውሮ (0 መሰረት ዝገበረ፣ ምስ ስርዓት ዝመሳሰል)። ቅድሚ እቲ ዕላማ ዝገበረ ኣቕሓ ምርኣይ (ማለት ቅድሚ እቲ slid.bs.carouselፍጻመ ምፍጣሩ) ናብቲ ደዋሊ ይምለስ።

.carousel('prev')

Cycles to the previous item. Returns to the caller before the previous item has been shown (i.e. before the slid.bs.carousel event occurs).

.carousel('next')

Cycles to the next item. Returns to the caller before the next item has been shown (i.e. before the slid.bs.carousel event occurs).

.carousel('dispose')

Destroys an element’s carousel.

.carousel('nextWhenVisible')

Don’t cycle the carousel to next when the page isn’t visible or the carousel or its parent isn’t visible. Returns to the caller before the next item has been shown (i.e. before the slid.bs.carousel event occurs).

.carousel('to')

Cycles the carousel to a particular frame (0 based, similar to an array). Returns to the caller before the next item has been shown (i.e. before the slid.bs.carousel event occurs).

Events

Bootstrap’s carousel class exposes two events for hooking into carousel functionality. Both events have the following additional properties:

  • direction: The direction in which the carousel is sliding (either "left" or "right").
  • relatedTarget: The DOM element that is being slid into place as the active item.
  • from: The index of the current item
  • to: The index of the next item

All carousel events are fired at the carousel itself (i.e. at the <div class="carousel">).

Event Type Description
slide.bs.carousel This event fires immediately when the slide instance method is invoked.
slid.bs.carousel This event is fired when the carousel has completed its slide transition.
$('#myCarousel').on('slide.bs.carousel', function () {
  // do something...
})

Change transition duration

ናይ ምስግጋር ንውሓት ግዜ ናይ ቅድሚ ምጥርናፍካ .carousel-itemብ Sass ተለዋዋጢ ወይ ብሕታዊ ቅዲታት ክትቅየር $carousel-transitionትኽእል ኢኻ እቲ ዝተጠርነፈ CSS ትጥቀም እንተኾንካ። ብዙሓት ምስግጋራት እንተተተግቢሮም፡ እቲ ናይ ምልዋጥ ምስግጋር መጀመርታ ከም ዝተገልጸ ኣረጋግጽ (ንኣብነት transition: transform 2s ease, opacity .5s ease-out)።