Default window size for webhelp?
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 156
- Joined: Sat Feb 26, 2005 12:09 am
- Location: USA
- Contact:
Default window size for webhelp?
Post by shudson310 »
I have a requirement to force the initial window size for webhelp content to 580x700. How can I set this initial window size? I've tried setting:
in wt_index.html, wt_search.html, wt_terms.html and wt_topic.html, but it does not appear to change the default window size.
Code: Select all
<script Language="JavaScript">
var width=580;
var height=700;
self.moveTo((screen.availwidth-width)/2,(screen.availheight-height)/2);
self.resizeTo(width,height);
</script>
Scott Hudson
Staff Content Engineer
Site: docs.servicenow.com
Staff Content Engineer
Site: docs.servicenow.com
-
- Posts: 222
- Joined: Tue Jul 01, 2014 11:48 am
Re: Default window size for webhelp?
Post by bogdan_cercelaru »
Hello,
You cannot resize or set the position of a browser window on the page load.
You can change only the properties of a new window opened by your script. This means that you should open a new window and set the properties you want: width, height, offset top and offset left.
Here is the script that will do this:
You have to include it in the wt_index.html, wt_search.html, wt_terms.html and wt_topic.html files.
Regards,
Bogdan
You cannot resize or set the position of a browser window on the page load.
You can change only the properties of a new window opened by your script. This means that you should open a new window and set the properties you want: width, height, offset top and offset left.
Here is the script that will do this:
Code: Select all
<script>
var myWindow;
var width=580;
var height=700;
var availHeight = screen.availHeight;
var availWidth = screen.availWidth;
var positionX = (availWidth-width)/2;
var positionY = (availHeight-height)/2;
var requestedURL = window.location;
if (window.name!=="myWindow") {
window.document.write("<p>This page open a new WebHelp window!</p>");
myWindow = window.open(requestedURL, "myWindow", "width=" + width + ", height=" + height + ", left=" + positionX + ", top=" + positionY);
myWindow.focus();
window.stop();
}
</script>
Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service