/    Sign up×
Community /Pin to ProfileBookmark

about expression

A lot of people say not to expression,Because Cost of a lot of memory and CPU.

so,How can change this procedure:

[COLOR=”Blue”]<div id=”text” style=”HEIGHT: 50px; POSITION: absolute; TOP: 10px; VISIBILITY: visible; LEFT: expression(eval(document.body.scrollLeft)+eval(document.body.clientWidth/2)-250); WIDTH: 140px; z-index:9999;”>[/COLOR]

Thanks

to post a comment
CSS

11 Comments(s)

Copy linkTweet thisAlerts:
@jackliuauthorJun 26.2009 — Nobody knows&#65311;
Copy linkTweet thisAlerts:
@aj_nscJun 26.2009 — Do you have a page that we can look at rather than one line of code?

From my first impression of it, I would say that you should look at using position: fixed.
Copy linkTweet thisAlerts:
@jackliuauthorJun 26.2009 — sorry,This page now is testing of my computer,and all tests are normal.

But this code([COLOR="Blue"]LEFT: expression(eval(document.body.scrollLeft)+eval(document.body.clientWidth/2)-250);[/COLOR]) is no-good.Mainly because of [COLOR="blue"]"expression"[/COLOR] is no-good.so,are there any other way?
Copy linkTweet thisAlerts:
@aj_nscJun 26.2009 — Did you look at position: fixed in my post above, it seems like it might accomplish your needs.
Copy linkTweet thisAlerts:
@jackliuauthorJun 26.2009 — no,no,no....this code("[COLOR="Blue"]LEFT: expression(eval(document.body.scrollLeft)+eval(document.body.clientWidth/2)-250);[/COLOR]")is correct, there is no problem.

What I mean is do not "[COLOR="blue"]expression[/COLOR]",
Copy linkTweet thisAlerts:
@jackliuauthorJun 26.2009 — Another way to achieve the same effect
Copy linkTweet thisAlerts:
@jackliuauthorJun 26.2009 — <script type="text/JavaScript">

function weizi(){

var weizileft=document.body.clientWidth/2 + document.body.scrollLeft - 250;

document.getElementById('test').style.left = weizileft;

}

</script>[/QUOTE]


I write,but have a small problem.
Copy linkTweet thisAlerts:
@ShortsJun 26.2009 — document.getElementById('test').style.left = weizileft+'px';
Copy linkTweet thisAlerts:
@jackliuauthorJun 27.2009 — I found only have the home page of Effect&#65292;but other pages are not.why?
Copy linkTweet thisAlerts:
@aj_nscJun 28.2009 — is that javascript executed on all the other pages as well?
Copy linkTweet thisAlerts:
@Declan1991Jun 28.2009 — When approaching a problem, you do not look at different ways of changing one solution, you look at the problem. If you wish to keep a certain element stationary on the page, look into position:fixed. If you have another problem, we can be more help if you tell us the problem, not one inelegant solution.
×

Success!

Help @jackliu spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...