Specific height for div in Mobile Windows 6.1

I always come to stackoverflow to check for answers; however, I have not yet found any relevant information on the current issue.

I have a PDA for mobile Windows 6.1, and I want to create a simple HTML page for it. I want certain page divs to have a certain height based on the text that is inside these divs.

  • Maximum I want 2 lines of text.
  • The text may contain HTML code. I want to cut the text, but it won't hurt the HTML.

Before you think: "There are 100 different CSS or Javascript solutions for this." I would like to mention that 6.1 uses a mixture of IE4 with some IE5 features. The browser only supports CCS1 (therefore max-height, no overflow: hidden, no position: absolute, no top, bottom, etc.).

The browser also supports a very limited set of Javascript features. I decided to analyze the Javascript DOM and constantly check if the text inside the div is larger than 28pt (these are two lines) and cut it. However, most DOM functions do not work. createElement () is not working, appendChild. Only getElementById and innerHTML work.

I found this solution https://code.google.com/p/cut-html-string/ for Javascript, which works great with modern browsers as it contains features like createElement (), appendChild (), cloneNode () etc. It does not work with IE4. The workaround for createElement () is innerHTML, which works fine, but then the browser reports errors for the DOM functions that the code uses.

PS: Please do not answer "change PDA, etc.". I know that the OS is very old, but I have to use it.

+4
source share
1 answer

Well, if you were dealing with one device style, you could use the javascript flash port, perhaps use the internal html settings to adapt to the new stylesheet so that you can work with this device if you need several devices you can create multiple style sheets. I would advise for testing purposes to find out if anyone has an Android device or a device with similar screen sizes so that you can use something like checking the edge from the adobe creative cloud, which you can configure and see the changes. Someone has a thing in the viewport. Finding the exact height and width of the viewport in cross-browser mode (without Prototype / jQuery) can be useful. Since you are working with basic javascript, you should just change the address of the css link, and this might be the solution. If I accepted any functionality of the device, I'm sorry, but it has been a while since I got a Windows Mobile 6.x mobile phone.

0
source

Source: https://habr.com/ru/post/1483334/


All Articles