Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I've removed most of the default elements with the following:

<style type="text/css"> #s4-ribbonrow, .ms-cui-topBar2, .s4-notdlg, .s4-pr s4-ribbonrowhidetitle, .s4-notdlg noindex, #ms-cui-ribbonTopBars, #s4-titlerow, #s4-pr s4-notdlg s4-titlerowhidetitle, #s4-leftpanel-content {display:none !important;}    .s4-ca{margin-left:0px !important; margin-right:0px !important;} </style>

All that I want to add is a simple button like this that takes the user back to the home page. I had something working (kind of), but the css stylesheets were not working. tried using a CEWP (my normal method) and a Page Viewer Web Part (would work, but the dimensions were too large).

just the most basic way to make a nice little button with jQuery.

Here's some more code.. just can't get it to play nicely with SP.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>jQuery UI Button - Default functionality</title>
  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/redmond/jquery-ui.css" />
  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/redmond/jquery-ui.css" />
  <script>
  $(function() {
    $( "input[type=submit], a" )
      .button()
      .click(function( event ) {

      });
  });
  </script>
</head>
<body>

<!-- <button></button> -->

<!-- <input type="submit" value="RE Home" /> -->

<a href="http://mysite/default.aspx">RE Home</a>


</body>
</html>
share|improve this question
    
do you want this button to goto a page or display inside a list for each item? –  Stephen Mar 1 '13 at 18:34
    
just want to go to a page. –  Bill Mar 1 '13 at 18:37
add comment

1 Answer 1

up vote 0 down vote accepted

ok if that's what you want this will do it...

<input type=button onClick="parent.location='http://mysite/default.aspx'" value='RE Home'>

Although there are several ways to do this but the above should be right...doing this from memory as I'm on my tablet...

Hope this helps

S

share|improve this answer
    
well what the hell - this is so goofy. ok i think i'm learning something here. why are there two references to css stylesheets? –  Bill Mar 1 '13 at 18:50
    
ok thanks - one last question - how can i get the theme to only apply to the button - not the entire page? –  Bill Mar 1 '13 at 18:55
    
I think it best to use CSS to control the look of the button if you want to isolate it from the rest of the look and feel. If you have this working could you mark up the answer? Cheers. –  Stephen Mar 3 '13 at 18:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.