Way to determine the visible size of the web page - browser

Is there a way for knowing what size was the visible portion of a page?
Are there any services that provide this? I mean, not just screen resolution, but available browser area. When a user has a lot of browser toolbars the area left for the webpage gets reduced. On the other hand, using Chrome may maximize the available space.
Thanks

Using Javascript, you can get the Window.InnerHeight & .InnerWidth

You'll have to use Javascript or JQuery to do so.
Here is a similar (answered) question

I found another implementation on StackOverflow itself which used jQuery.
$(window.top).width()
$(window.top).height()
P.S. Just don't forget the brackets as i always missed them.
Reference:
https://stackoverflow.com/a/7008807

Related

DoubleClick for Publishers - support multiple screen sizes

I'm showing banner at left in my web page.
According to screen size 160x600 or 300x600 have to be used.
I can determine screen size and set proper code, but I think this isn't correct way.
Does somebody know how to leave to DoubleClick to decide which one ad fits better in page?
Unfortunately DoubleClick documentation is from ancient times :)
Solution: Do not put baner size in web page. Set it dynamicaly in javascript code provided from Doubleclick.

Interacting with a SVG in Pharo?

I want to get a very basic interaction with a SVG loaded through Athens in Pharo using Morphic. This example shows what I'm looking for. I have used
(ASVGMorph fromFile: 'lion.svg') drawOn: Display getCanvas
but clicking the SVG makes the picture dissapear. However all examples I have seen were using a web browser. Is this possible using Athens? There is any other work in this area?
That's because you are drawing it in display canvas, which is refreshed every time... so is natural that you lost it...
What you need to do is:
(ASVGMorph fromFile: 'lion.svg') openInWorld.
or better, you probably want to put it in a window:
(ASVGMorph fromFile: 'lion.svg') openInWindow.
at the end, you will probably want it inside some other morph that you create, but debugging anyone of the solutions above with show you how to proceed :)
Yes, as Esteban pointed, to keep morph on desktop, you should add it to world, i.e. use
openInWorld, or #openInWindow.
ASVGMorph is very basic, however, and not intended to serve all possible use cases.
For more advanced uses, it is preferred to use ASVGRoot instance and draw it in own morph or compose with other drawings.

fb request dialog appearing party out of window

I am asking for help, we have a request dialog in our app, but it appears partly out of the screen so its croped a bit on the right side.
We would like to center it so it wouldn`t be croped. Would anyone know how to fix that please?
Thanks
I had the same problem. I'm not sure about the way how to position dialog itself. IMHO it can also depend on location of click event. Anyway, I've found ugly, but quite functional way to fix it with JavaScript:
setInterval("$('.fb_dialog').css('left', '0');", 1500);
The dialog itself cannot be repositioned.
Are you using iframes in your code by any chance?
Try changing the width in your CSS file to something smaller and see if it makes a difference. The Request Dialog usually positions itself in the middle of a page by detecting the size of the page / frame.

Web Browser zoom via javascript and graceful degrading

I'm working on a web project that has some accessibility features mandated by the client, including a "font size changer" to allow the font size to be increased for visually impaired users.
Despite my arguments that a better experience will be had by using the built-in zoom features in the browser, the client has insisted that their users will not know to use these built-in features, so we must provide a text size changing widget.
What I'd like to do, if possible, is cause these page elements to invoke the browser's own zoom functionality (Ctrl + + in firefox, for example). If the browser doesn't support this method of zooming, then I might fall back to increasing the font size with css.
How can I best implement this kind of feature? Is it even possible? Is there some solution that I've overlooked?
There is no way as far as I know to use the browser's built in function. However it can be done with CSS3 or javascript. for a CSS3 example look here: http://www.css3.com/css-zoom/

Working arround font rendering issues in all major browsers

Since long time i been having a real problem with the different ways that each browser display text.
Sure you have noticed that even when you create a stylesheet specifying everything about the font properties, still every browser display the same text with some differences, the usual problem is the font weight, that even if you specify it different browsers display it different ways.
I would like to know if some as come with a solution. Not turning the text into a image.
Thanks.
EDIT:
This is a example of the problem. On the left Firefox and right IE. However i have defined in the CSS font family, weight, size and still they render the fonts different.
Snapshot
Do you mean that on one browser its bold and another one its normal? A reset should fix that, but if it doesn't, it might be something overriding that.
If you're talking about fonts looking different, it is possible - for example, since Google Chrome / Chromium sandboxes the renderer process, the font rendering won't be affected by other parts of the system, and I believe that it uses some sort of special font rendering. To be honest, on my Linux install, I do get bolder fonts on Chromium, but Firefox displays them fine.
There's SIFR (as pointed above), but it needs Flash and it is a bit heavy. There's also Cufon http://cufon.shoqolate.com/ that uses Javascript. Could you show a screencast so we know what's the problem? Thanks.
SIFR is a good solution, as long as you're only trying to control the appearance of small chunks of text (headings, design elements, etc.)
Beyond that, browsers are perfectly allowed to render text any way they want, and getting it pixel-perfect between browsers and operating systems is usually not even desirable for larger chunks of text. Users will have different accessibility settings and anti-aliasing settings which are tuned to the way they want to read text, and in general websites should try to respect that.
You can use SIFR.
Although this problem is already about a week old, here is a solution that I found, that might be related:
http://blog.wolffmyren.com/2009/05/28/jquery-fadeinfadeout-ie-cleartype-glitch/
If you're not using jQuery, try removing the filter attribute from the elements that are displaying non-Cleartype'd text and it should work, according to that blog post.

Resources