21.02.2010: Updated the post with the code for floating the site action menu to the right on the screen (as requested by Larry).
This one proved a bit tricky because the site action menu is part of the master page.
See codeblock below for updated code. Please let me know if you find any bugs.
After i posted the solution to Move view selector to the left, i got a request from Charlie Epes for the same solution regarding the “Site Actions-menu”.
This is the default placement of the Site Actions-menu:
Here the menu is inserted after the last toplink (dynamic):
Here is how it’s done
Add a CEWP below the list view, and add this code (alter the location of the jQuery-scipt as needed)
<script type="text/javascript" src="../../Javascript/jquery-1.3.2.min.js"></script> <script type="text/javascript"> $("table.ms-bannerframe table:first td:last").after($("table.ms-bannerframe td:last")); </script>
Code for floating the menu to the right (replace the code supplied above with this one):
<script type="text/javascript" src="../../Javascript/jquery-1.3.2.min.js"></script> <script type="text/javascript"> // Site action float right $(document).ready(function(){ setTimeout(function(){ siteActionFloatRight(); },500); }); function siteActionFloatRight(){ var menuWidth = $("table.ms-siteaction").width(); var doc = $(document).width(); var win = $(window).width(); var scr = $(window).scrollLeft(); left = doc-win-scr+menuWidth; if(left<120){ left=100; } // Move the site action menu to the new position $("table.ms-siteaction").css({'position':'absolute','top':0,'left':-left}); } // Handle resize and scroll $(window).resize(function() { siteActionFloatRight(); }).scroll(function() { siteActionFloatRight(); }); // Make it adapt to changing document width due to expanding groups $("td[class^='ms-gb']").click(function(){ setTimeout(function(){ siteActionFloatRight(); },250); }); </script>
Regards
Alexander
Ha! Thanks Alexander! That was quick!
Charlie Epes
That´s a another good one, keep up with your great JS work, I like what you are doing!
Can you do the same thing as the view selector, float Site Actions on the right? I tried tweeking that script, but no luck for me.
Hi,
This one proved a bit more tricky as the site action menu is part pf the master page and does not want to be moved around like the view selector.
I have made it 90%, but it requires some more testing before it is “released”.
Alexander
as always, you are the man!
I finally got to answer this one.
Alexander
Anyone got this working for 2010?
Tom
Hi,
Not sure what you mean – the site action menu is on the left side in SP2010.
Alexander