[-- Attachment #1: Type: text/plain, Size: 668 bytes --] Hi, For my CV I'm trying to place a box (div, whatever) at the left edge of the content-div. My org-file looks like - year0–year1 :: FooCorp - note1 - note2 {{{BOL(year½)}}} And I want the ouput to look like: year0–year1 FooCorp - note1 year½ - note2 In the attached example I have the desired output for LaTeX, and the output for html is also fine *as long as you don't zoom*. The issue is that the javascript that I use absolute position in pixels, and the browser doesn't update the location when zooming... Any ideas on how to solve this? Thanks, Rasmus -- Together we will make the possible totalllly impossible! [-- Attachment #2: test.org --] [-- Type: application/vnd.lotus-organizer, Size: 3095 bytes --]
> The issue is
> that the javascript that I use absolute position in pixels, and the
> browser doesn't update the location when zooming...
>
> Any ideas on how to solve this?
Which browser? It seems to work well with zooming in Firefox and Safari,
so I'd say you're doing something right and the browser's doing
something wrong. (As you can guess from my attitude, though, I'm not a
professional web developer.)
Yours,
Christian
Rasmus <rasmus-0UDz38MK/Mo@public.gmane.org> writes:
> Hi,
>
> For my CV I'm trying to place a box (div, whatever) at the left edge of
> the content-div. My org-file looks like
>
> - year0–year1 :: FooCorp
> - note1
> - note2 {{{BOL(year½)}}}
>
> And I want the ouput to look like:
>
> year0–year1 FooCorp
> - note1
> year½ - note2
>
> In the attached example I have the desired output for LaTeX, and the
> output for html is also fine *as long as you don't zoom*. The issue is
> that the javascript that I use absolute position in pixels, and the
> browser doesn't update the location when zooming...
>
> Any ideas on how to solve this?
Hoping for pixel perfect rendering for html is fraught with difficulty -
it's not really designed for that sort of thing. If that's what you want
then you may be better off producing a pdf.
[-- Attachment #1: Type: text/plain, Size: 940 bytes --] Hi Christian, Christian Moe <mail@christianmoe.com> writes: >> The issue is >> that the javascript that I use absolute position in pixels, and the >> browser doesn't update the location when zooming... >> >> Any ideas on how to solve this? > > Which browser? It seems to work well with zooming in Firefox and Safari, > so I'd say you're doing something right and the browser's doing > something wrong. For a moment I hoped it was just a bug in the larger stylesheet(!). Unfortunately, I think the nice behavior you saw was 'cause my example was too minimal... Try the attached file which has a title. I definitely see it here, zooming in and out, especially when the window ain't to large... BTW: I tested using Firefox and Gnome Web. > (As you can guess from my attitude, though, I'm not a professional web > developer.) As you can /see/, me neither... Thanks, Rasmus -- Together we will make the possible totalllly impossible! [-- Attachment #2: test.org --] [-- Type: application/vnd.lotus-organizer, Size: 3381 bytes --]
Paul Rudin <paul@rudin.co.uk> writes: > Hoping for pixel perfect rendering for html is fraught with difficulty - > it's not really designed for that sort of thing. I'm only asking for two things (divs/spans) to be (almost) on the same line (if you rerun the new example I sent to Christian you might see it can go quite bad or see this¹ screen-shot)... I tried to put the script in window.onresize but somehow it's not always working... > If that's what you want then you may be better off producing a pdf. I prefer both. Html is very comfortable on the screen and it's remarkably capable for printing these days as well via CSS. E.g. I found this, @media print {div[class^="outline-"], div[class*=" outline-"] {page-break-inside: avoid;}} Which makes page-breaks on print sensible. I'm still having issues with small-caps, and a \vfill replacement for print. And the above. Other than that I'm quite pleased with html. —Rasmus Footnotes: ¹ Here's what it looks like zooming in and out: http://i.imgur.com/RLHI47C.png -- Bang bang
It still works fine for me in Firefox with the added title and text,
zooming in and out (except when the window becomes seriously too small,
and the year jumps up on top of the other one, but that, I think, has to
be expected).
A different problem is that the script only picks out every other
bol-year DIV, as you will soon see if you add more entries with boxes on
the left. The reason is that getElementsByClassName returns a live
HTMLCollection that updates according to the document order of the
elements even as the script changes that order. To loop through them,
try simply
var e = elements[0]; // instead of var e = elements[i];
Yours,
Christian
Rasmus writes:
> Hi Christian,
>
> Christian Moe <mail@christianmoe.com> writes:
>
>>> The issue is
>>> that the javascript that I use absolute position in pixels, and the
>>> browser doesn't update the location when zooming...
>>>
>>> Any ideas on how to solve this?
>>
>> Which browser? It seems to work well with zooming in Firefox and Safari,
>> so I'd say you're doing something right and the browser's doing
>> something wrong.
>
> For a moment I hoped it was just a bug in the larger stylesheet(!).
> Unfortunately, I think the nice behavior you saw was 'cause my example was
> too minimal... Try the attached file which has a title. I definitely see
> it here, zooming in and out, especially when the window ain't to large...
>
> BTW: I tested using Firefox and Gnome Web.
>
>> (As you can guess from my attitude, though, I'm not a professional web
>> developer.)
>
> As you can /see/, me neither...
>
> Thanks,
> Rasmus
[-- Attachment #1: Type: text/plain, Size: 1268 bytes --] Hi Christian, Thanks for the insightful comments. Javascript is an interesting domain; totally foreign to me, though. Christian Moe <mail@christianmoe.com> writes: > (except when the window becomes seriously too small, > and the year jumps up on top of the other one, but that, I think, has to > be expected). This is what I'm trying to get rid of, somehow... In my full document it seemed to jump around much more. . . I think I got it working now by rerunning the script on resize and cloning the node rather than modifying the original node. I have no idea if this is bad. It works wonderfully in the newest Firefox and Gnome Web. > A different problem is that the script only picks out every other > bol-year DIV, as you will soon see if you add more entries with boxes on > the left. The reason is that getElementsByClassName returns a live > HTMLCollection that updates according to the document order of the > elements even as the script changes that order. Interesting. > To loop through them, try simply > > var e = elements[0]; // instead of var e = elements[i]; Thanks this is very helpful. Next step: Proper small caps and make it work well on my phone! Thanks, Rasmus -- And I faced endless streams of vendor-approved Ikea furniture. . . [-- Attachment #2: test.org --] [-- Type: application/vnd.lotus-organizer, Size: 4047 bytes --]