0

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>
2
  • do you want this button to goto a page or display inside a list for each item?
    – Stephen
    Mar 1, 2013 at 18:34
  • just want to go to a page.
    – Bill
    Mar 1, 2013 at 18:37

1 Answer 1

0

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

3
  • 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, 2013 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, 2013 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, 2013 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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