1

i am trying to change the style of my css class in edit mode but nothing happens here is my code

 <Publishing:EditModePanel runat="server" id="editmodestyles"> <script type="text/javascript">$(.center).css('height', '300px');</script> <SharePoint:CssRegistration ID="CssRegistration1" name="&lt;% $SPUrl:~sitecollection/Style Library/~language/Themable/Core Styles/editmode15.css %&gt;" After="&lt;% $SPUrl:~sitecollection/Style Library/~language/Themable/Core Styles/pagelayouts15.css %&gt;" runat="server"> </SharePoint:CssRegistration> </Publishing:EditModePanel> 
1
  • Might be missing document ready? Anyway, why use JS when you could just add CSS? Commented Feb 25, 2015 at 8:19

1 Answer 1

0

Might be some small details missing that's the cause. Try this:

<script type="text/javascript"> $(function (){ $('.center').css('height', '300px'); }); </script> 
4
  • i cant save when adding that code Commented Feb 25, 2015 at 12:28
  • @Martin You can't save? Ok, I have never experienced that before when adding custom javascript to the pages. Commented Feb 25, 2015 at 16:07
  • Yes i cant save. The ribbon inside Edit also gets disabled Commented Feb 25, 2015 at 19:55
  • I will update my code Commented Feb 26, 2015 at 6:38

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.