![]() |
|
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread |
|
|
PM User | #1 |
|
New Coder ![]() Join Date: Oct 2009
Posts: 72
Thanks: 2
Thanked 1 Time in 1 Post
![]() |
change font size mid line
I want to deviate from using css to designate a font size in one place.
I have a string with a name. This is stored in a variable called "name." I just re-defined name to include district number. Now, it is name=lastname+', '+district; I am appending this string into the html dom. I want the district portion to appear in a slightly smaller font. How can I do this without having to set up a separate <span>? Or can this be done? |
|
|
|
|
|
PM User | #2 | |
|
Senior Coder ![]() ![]() Join Date: Dec 2007
Posts: 4,658
Thanks: 374
Thanked 562 Times in 551 Posts
![]() ![]() |
Quote:
or more simple: Code:
name = lastname +', <span style="font-size: 7pt;">' + district + '</span>'; Edit: oops, I didn't see you mention span, ![]() Edit: the font size inside a element will be the same overall, you need a inner element to make it different best regards Last edited by oesxyl; 11-07-2009 at 04:46 AM.. |
|
|
|
|
|
|
PM User | #3 |
|
New Coder ![]() Join Date: Oct 2009
Posts: 72
Thanks: 2
Thanked 1 Time in 1 Post
![]() |
I guess it's no big deal. I'll add a span. It's just this is in a navigation pane where a traverse parents and siblings to act on them when user clicks and mouses in that area. Another span might cause the family structure to change.
If it turns out to be a nightmare, I can put it back. Thanks. |
|
|
|
|
|
PM User | #4 |
|
New Coder ![]() Join Date: Oct 2009
Posts: 72
Thanks: 2
Thanked 1 Time in 1 Post
![]() |
Since you're 2 for 2, I have another question.
I am trying to optimize for speed. I don't know how to be a judge of how fast things should take. I am putting pushpins next to names (places) in the navigation panel I wrote. There can be around 150 names in the list, meaning I am loading a little icon (pushpin) from Google's url about 150 times. Should this be an area where I could make adjustments and improve speed? Basically, map loads in 9-10 seconds. I shouldn't complain as it is amazing what you can do these days, but.... |
|
|
|
|
|
PM User | #5 | |
|
Senior Coder ![]() ![]() Join Date: Dec 2007
Posts: 4,658
Thanks: 374
Thanked 562 Times in 551 Posts
![]() ![]() |
Quote:
https://addons.mozilla.org/en-US/firefox/addon/216 I guess that loading the icon from google happend only once, first time, in the rest is using the cache, that's ofcourse if you don't have pragma no-cache. If you have and become a problem you can load all this stuff at the begining of the script and reuse it latter but this will complicate the script. best regards |
|
|
|
|
|
|
PM User | #6 |
|
Senior Coder ![]() Join Date: Feb 2009
Location: Snohomish, WA
Posts: 4,045
Thanks: 18
Thanked 656 Times in 648 Posts
![]() ![]() |
Oesxyl is of course correct. Browsers are smart enough to not go get an image more than once from the server. I'm not sure, but I think even a pragma no-cache wouldn't apply to using the same image in the same page occurrence. As that doesn't really involve caching, per se.
__________________
"Old age and cunning win out over youth and enthusiasm every time." |
|
|
|
|
|
PM User | #7 |
|
New Coder ![]() Join Date: Oct 2009
Posts: 72
Thanks: 2
Thanked 1 Time in 1 Post
![]() |
Good answers! That is helping to narrow down the source of drag in loading a map in Google Earth, while at the same time, using some jscript to update a navigation pane to the left of it.
Two things: 1. How owuld I empty my browser's cache to check speed as I develop? "Deleting temporary files" is not what I want because it tells me it will wipe-out saved passwords and other things. 2. To simplify the description of what my app. is doing, I load a US Map which contains only polygons which are state boundaries. THe boundaries, in all, contain probably 12,000 points. THe file size is about 127k. This map loads pretty quick - about 2-3 seconds. I then load a Texas map. It has boundaries of election districts. These are probably roughly the same number of points. The size of the file is about 147k. The Texas map takes about 10-12 seconds to load. There is a difference from the US map in that it contains some database information on each district - about 40 fields for each of 150 districts. These, I would assume, all load into memory. Also, when I load the Texas map, I expand the navigation tree on the left. It creates a line in the panel for each district, so the user can click on that district and fly there. Each displayed line has either a yellow or blue pushpin and alos, either an elephant or donkey - depending on whether the legislator is Rep. or Dem. Now that you indicate it is not re-loading the images over and over, this leads me to suspect it must be the 40 fields per district that is dragging it down. Have I supplied enough information to allow anyone to give me advice on whether they agree and/or what I might do to improve speed? |
|
|
|
|
|
PM User | #8 | |||
|
Senior Coder ![]() ![]() Join Date: Dec 2007
Posts: 4,658
Thanks: 374
Thanked 562 Times in 551 Posts
![]() ![]() |
Quote:
Quote:
https://addons.mozilla.org/en-US/firefox/addon/60 I don't think is a good idea to store password and user names in browser but maybe I'm a little paranoic, ![]() Quote:
best regards |
|||
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Rate This Thread | |
|
|