<!-- code formatted by http://manoli.net/csharpformat/ --> <pre class="csharpcode"> <span class="rem">/* START --- scroll till anchor */</span> (function($) { $.fn.goTo = function() { <span class="kwrd">var</span> top_menu_height=$(<span class="str">'#div_menu_header'</span>).height() + 5 ; <span class="rem">//alert ( 'top_menu_height is:' + top_menu_height );</span> $(<span class="str">'html, body'</span>).animate({ scrollTop: (-1)*top_menu_height + $(<span class="kwrd">this</span>).offset().top + <span class="str">'px'</span> }, 500); <span class="kwrd">return</span> <span class="kwrd">this</span>; <span class="rem">// for chaining...</span> } })(jQuery); $(document).ready(function(){ <span class="kwrd">var</span> url = document.URL, idx = url.indexOf(<span class="str">"#"</span>) ; <span class="kwrd">var</span> hash = idx != -1 ? url.substring(idx+1) : <span class="str">""</span>; $(window).load(function(){ <span class="rem">// Remove the # from the hash, as different browsers may or may not include it</span> <span class="kwrd">var</span> anchor_to_scroll_to = location.hash.replace(<span class="str">'#'</span>,<span class="str">''</span>); <span class="kwrd">if</span> ( anchor_to_scroll_to != <span class="str">''</span> ) { anchor_to_scroll_to = <span class="str">'#'</span> + anchor_to_scroll_to ; $(anchor_to_scroll_to).goTo(); } }); }); <span class="rem">/* STOP --- scroll till anchror */</span></pre>
Getting the Current TabItem when the Tab is not selected in WPF
-
[image: Banner]
This is a quick reminder to self on how to retrieve a TabItem from a WPF
TabControl *when the tab is not currently selected* because I ru...
1 month ago