Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I hope this code helps you and answers to your question.</p> <p><strong>HTML :</strong></p> <pre><code>&lt;div id="background"&gt; &lt;div id="transition"&gt; &lt;div class="pointer"&gt;&lt;/div&gt; &lt;div class="behind-pointer"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div style="clear:both"&gt;&lt;/div&gt; </code></pre> <p><strong>CSS :</strong></p> <pre><code>#transition { height : 100%; width : 100%; } .pointer { width : 0; height : 0; border-left: 70px solid transparent; /* Arrow width */ float : left; } .behind-pointer { background-color : white; /* Color transition */ height : 100%; } #background { height : 150px; width : 250px; background-color: black; } </code></pre> <p><strong>jQuery :</strong></p> <pre><code>$(document).ready(function(){ var color = $("#transition .behind-pointer").css("background-color"); var transition = $("#transition"); var transition_pointer = $("#transition .pointer"); var left_width = new Number(transition_pointer.css("border-left-width").replace("px", "")); var behind_pointer = $("#transition .behind-pointer"); transition.css("width", (transition.width() + left_width) + "px"); transition.css("position", "relative").css("left", "-" + left_width + "px"); transition_pointer.css("border-bottom", transition.height()/2 + "px solid " + color) .css("border-top", $("#transition").height()/2 + "px solid "+ color); behind_pointer.css("margin-left", left_width + "px"); var width = transition.width(); transition.animate({ left : width - left_width, width : 0 }, 2000, function(){ transition.hide(); }); }); </code></pre> <p><a href="http://jsfiddle.net/charlesjourdan/NDm3y/6/" rel="nofollow">Here</a> there is a jsFiddle example</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload