Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>well thanks for telling me the method but i know that thing, i am just not able to implement in it. Hi first i did this i add this code</p> <pre><code>$("#gamecategoriest").quicksand( $("#data &gt; li"), { duration: 1000 }, function() { // callback function $('#gamecategories a.tip_trigger').hover(function(){ tip = $(this).find('.tip'); ..... tip.css({ top: mousey, left: mousex }); }); } ); </code></pre> <p>just after these lines of code of yours as at the complete end i added the above code $preferences.useScaling = true;</p> <pre><code> $performance_container.html($original_html); high_performance = true; } e.preventDefault(); }); }); </code></pre> <p>so the end result in the end looked like this</p> <pre><code>&lt;script type="text/javascript"&gt; (function($) { $.fn.sorted = function(customOptions) { var options = { reversed: false, by: function(a) { return a.text(); } }; $.extend(options, customOptions); $data = $(this); arr = $data.get(); arr.sort(function(a, b) { var valA = options.by($(a)); var valB = options.by($(b)); if (options.reversed) { return (valA &amp;lt; valB) ? 1 : (valA &amp;gt; valB) ? -1 : 0; } else { return (valA &amp;lt; valB) ? -1 : (valA &amp;gt; valB) ? 1 : 0; } }); return $(arr); }; })(jQuery); $(function() { var read_button = function(class_names) { var r = { selected: false, type: 0 }; for (var i=0; i &amp;lt; class_names.length; i++) { if (class_names[i].indexOf(&amp;#39;selected-&amp;#39;) == 0) { r.selected = true; } if (class_names[i].indexOf(&amp;#39;segment-&amp;#39;) == 0) { r.segment = class_names[i].split(&amp;#39;-&amp;#39;)[1]; } }; return r; }; var determine_sort = function($buttons) { var $selected = $buttons.parent().filter(&amp;#39;[class*=&amp;quot;selected-&amp;quot;]&amp;#39;); return $selected.find(&amp;#39;a&amp;#39;).attr(&amp;#39;data-value&amp;#39;); }; var determine_kind = function($buttons) { var $selected = $buttons.parent().filter(&amp;#39;[class*=&amp;quot;selected-&amp;quot;]&amp;#39;); return $selected.find(&amp;#39;a&amp;#39;).attr(&amp;#39;data-value&amp;#39;); }; var $preferences = { duration: 800, easing: &amp;#39;easeInOutQuad&amp;#39;, adjustHeight: false }; var $list = $('#data'); var $data = $list.clone(); var $controls = $('ul#gamecategories ul'); $controls.each(function(i) { var $control = $(this); var $buttons = $control.find(&amp;#39;a&amp;#39;); $buttons.bind(&amp;#39;click&amp;#39;, function(e) { var $button = $(this); var $button_container = $button.parent(); var button_properties = read_button($button_container.attr(&amp;#39;class&amp;#39;).split(&amp;#39; &amp;#39;)); var selected = button_properties.selected; var button_segment = button_properties.segment; if (!selected) { $buttons.parent().removeClass(&amp;#39;selected-0&amp;#39;).removeClass(&amp;#39;selected-1&amp;#39;).removeClass(&amp;#39;selected-2&amp;#39;); $button_container.addClass(&amp;#39;selected-&amp;#39; + button_segment); var sorting_type = determine_sort($controls.eq(1).find(&amp;#39;a&amp;#39;)); var sorting_kind = determine_kind($controls.eq(0).find(&amp;#39;a&amp;#39;)); if (sorting_kind == &amp;#39;all&amp;#39;) { var $filtered_data = $data.find(&amp;#39;li&amp;#39;); } else { var $filtered_data = $data.find(&amp;#39;li.&amp;#39; + sorting_kind); } if (sorting_type == &amp;#39;size&amp;#39;) { var $sorted_data = $filtered_data.sorted({ by: function(v) { return parseFloat($(v).find(&amp;#39;span&amp;#39;).text()); } }); } else { var $sorted_data = $filtered_data.sorted({ by: function(v) { return $(v).find(&amp;#39;strong&amp;#39;).text().toLowerCase(); } }); } $list.quicksand($sorted_data, $preferences); } e.preventDefault(); }); }); var high_performance = true; var $performance_container = $('#performance-toggle'); var $original_html = $performance_container.html(); $performance_container.find('a').live('click', function(e) { if (high_performance) { $preferences.useScaling = false; $performance_container.html(&amp;#39;CSS3 scaling turned off. Try the demo again. &amp;lt;a href=&amp;quot;#toggle&amp;quot;&amp;gt;Reverse&amp;lt;/a&amp;gt;.&amp;#39;); high_performance = false; } else { $preferences.useScaling = true; $performance_container.html($original_html); high_performance = true; } e.preventDefault(); }); }); $("#gamecategoriest").quicksand( $("#data &gt; li"), { duration: 1000 }, function() { // callback function $('#gamecategories a.tip_trigger').hover(function(){ tip = $(this).find('.tip'); ..... tip.css({ top: mousey, left: mousex }); }); } ); &lt;/script&gt; </code></pre> <p>by doing above thing my tooltip was working but after animation it stopped. So i did this then i replaced this <code>$list.quicksand($sorted_data, $preferences);</code> with this <code>$list.quicksand($sorted_data, $preferences, function () { $(this).tooltip (); } );</code> and i added this code</p> <pre><code>jQuery.fn.tooltip = function () { this.each ( function ( index, element ) { $(element).mouseover(function(){ tip = $(this).find('.tip'); tip.show(); //Show tooltip }).mouseout ( function() { tip.hide(); //Hide tooltip }).mousemove(function(e) { var mousex = e.pageX + 20; //Get X coodrinates var mousey = e.pageY + 20; //Get Y coordinates var tipWidth = tip.width(); //Find width of tooltip var tipHeight = tip.height(); //Find height of tooltip //Distance of element from the right edge of viewport var tipVisX = $(window).width() - (mousex + tipWidth); //Distance of element from the bottom of viewport var tipVisY = $(window).height() - (mousey + tipHeight); if ( tipVisX &lt; 20 ) { //If tooltip exceeds the X coordinate of viewport mousex = e.pageX - tipWidth - 20; } if ( tipVisY &lt; 20 ) { //If tooltip exceeds the Y coordinate of viewport mousey = e.pageY - tipHeight - 20; } //Absolute position the tooltip according to mouse position tip.css({ top: mousey, left: mousex }); }); }); }; </code></pre> <p>just after this code at the end of your code</p> <pre><code>$preferences.useScaling = true; $performance_container.html($original_html); high_performance = true; } e.preventDefault(); }); }); </code></pre> <p>so the end result will look like this</p> <pre><code>&lt;script type="text/javascript"&gt; (function($) { $.fn.sorted = function(customOptions) { var options = { reversed: false, by: function(a) { return a.text(); } }; $.extend(options, customOptions); $data = $(this); arr = $data.get(); arr.sort(function(a, b) { var valA = options.by($(a)); var valB = options.by($(b)); if (options.reversed) { return (valA &amp;lt; valB) ? 1 : (valA &amp;gt; valB) ? -1 : 0; } else { return (valA &amp;lt; valB) ? -1 : (valA &amp;gt; valB) ? 1 : 0; } }); return $(arr); }; })(jQuery); $(function() { var read_button = function(class_names) { var r = { selected: false, type: 0 }; for (var i=0; i &amp;lt; class_names.length; i++) { if (class_names[i].indexOf(&amp;#39;selected-&amp;#39;) == 0) { r.selected = true; } if (class_names[i].indexOf(&amp;#39;segment-&amp;#39;) == 0) { r.segment = class_names[i].split(&amp;#39;-&amp;#39;)[1]; } }; return r; }; var determine_sort = function($buttons) { var $selected = $buttons.parent().filter(&amp;#39;[class*=&amp;quot;selected-&amp;quot;]&amp;#39;); return $selected.find(&amp;#39;a&amp;#39;).attr(&amp;#39;data-value&amp;#39;); }; var determine_kind = function($buttons) { var $selected = $buttons.parent().filter(&amp;#39;[class*=&amp;quot;selected-&amp;quot;]&amp;#39;); return $selected.find(&amp;#39;a&amp;#39;).attr(&amp;#39;data-value&amp;#39;); }; var $preferences = { duration: 800, easing: &amp;#39;easeInOutQuad&amp;#39;, adjustHeight: false }; var $list = $('#data'); var $data = $list.clone(); var $controls = $('ul#gamecategories ul'); $controls.each(function(i) { var $control = $(this); var $buttons = $control.find(&amp;#39;a&amp;#39;); $buttons.bind(&amp;#39;click&amp;#39;, function(e) { var $button = $(this); var $button_container = $button.parent(); var button_properties = read_button($button_container.attr(&amp;#39;class&amp;#39;).split(&amp;#39; &amp;#39;)); var selected = button_properties.selected; var button_segment = button_properties.segment; if (!selected) { $buttons.parent().removeClass(&amp;#39;selected-0&amp;#39;).removeClass(&amp;#39;selected-1&amp;#39;).removeClass(&amp;#39;selected-2&amp;#39;); $button_container.addClass(&amp;#39;selected-&amp;#39; + button_segment); var sorting_type = determine_sort($controls.eq(1).find(&amp;#39;a&amp;#39;)); var sorting_kind = determine_kind($controls.eq(0).find(&amp;#39;a&amp;#39;)); if (sorting_kind == &amp;#39;all&amp;#39;) { var $filtered_data = $data.find(&amp;#39;li&amp;#39;); } else { var $filtered_data = $data.find(&amp;#39;li.&amp;#39; + sorting_kind); } if (sorting_type == &amp;#39;size&amp;#39;) { var $sorted_data = $filtered_data.sorted({ by: function(v) { return parseFloat($(v).find(&amp;#39;span&amp;#39;).text()); } }); } else { var $sorted_data = $filtered_data.sorted({ by: function(v) { return $(v).find(&amp;#39;strong&amp;#39;).text().toLowerCase(); } }); } $list.quicksand($sorted_data, $preferences, function () { $(this).tooltip (); } ); } e.preventDefault(); }); }); var high_performance = true; var $performance_container = $('#performance-toggle'); var $original_html = $performance_container.html(); $performance_container.find('a').live('click', function(e) { if (high_performance) { $preferences.useScaling = false; $performance_container.html(&amp;#39;CSS3 scaling turned off. Try the demo again. &amp;lt;a href=&amp;quot;#toggle&amp;quot;&amp;gt;Reverse&amp;lt;/a&amp;gt;.&amp;#39;); high_performance = false; } else { $preferences.useScaling = true; $performance_container.html($original_html); high_performance = true; } e.preventDefault(); }); }); jQuery.fn.tooltip = function () { this.each ( function ( index, element ) { $(element).mouseover(function(){ tip = $(this).find(&amp;#39;.tip&amp;#39;); tip.show(); //Show tooltip }).mouseout ( function() { tip.hide(); //Hide tooltip }).mousemove(function(e) { var mousex = e.pageX + 20; //Get X coodrinates var mousey = e.pageY + 20; //Get Y coordinates var tipWidth = tip.width(); //Find width of tooltip var tipHeight = tip.height(); //Find height of tooltip //Distance of element from the right edge of viewport var tipVisX = $(window).width() - (mousex + tipWidth); //Distance of element from the bottom of viewport var tipVisY = $(window).height() - (mousey + tipHeight); if ( tipVisX &amp;lt; 20 ) { //If tooltip exceeds the X coordinate of viewport mousex = e.pageX - tipWidth - 20; } if ( tipVisY &amp;lt; 20 ) { //If tooltip exceeds the Y coordinate of viewport mousey = e.pageY - tipHeight - 20; } //Absolute position the tooltip according to mouse position tip.css({ top: mousey, left: mousex }); }); }); }; &lt;/script&gt; </code></pre> <p>i think i am adding the codes to the wrong placesin your given script the test page is at <a href="http://letseedrop.blogspot.com/2011/01/testing-3.html" rel="nofollow">http://letseedrop.blogspot.com/2011/01/testing-3.html</a> and if the code is not very well readable then you can check it from here too i posted a comment there too <a href="https://github.com/razorjack/quicksand/issues/44" rel="nofollow">https://github.com/razorjack/quicksand/issues/44</a></p>
    singulars
    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. 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