Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ned help positioning dor on an image (location of product)

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
0
36
US
I have this code which positions the bullet image on the underlying blueprint.

But I would like to pass the X-Y cords to the page some how, so when it is loaded it shows the bullet where it is each time. How do I make the 400 and 500 be variables in HTML is that possible?

Or if there is another way Great. Also this method changes the position of the bullet depending on which device it running on, so this is not the best way anyway.

Code:
<asp:Panel ID="Panel1" runat="server" Height="16px" Width="800px">
        <asp:Label ID="lblLocation" runat="server" BackColor="Red" BorderColor="Maroon" Text=" * "></asp:Label>
        <img alt="" class="auto-style1" src="Images/Blueprint.jpg" />
        <img src="images/BulletRed.png" style="position:absolute; top:[highlight #FCE94F]400[/highlight]px; left:[highlight #FCE94F]500p[/highlight]x;"/>
    </asp:Panel>

DougP
 
This is a HTML & CSS 'issue' NOT a server side code one.

400 and 500 be variables in HTML is that possible?
No,

A: Because they are CSS property valuess

B: HTML doesn't have 'variables'


Or if there is another way Great. Also this method changes the position of the bullet depending on which device it running on, so this is not the best way anyway.
Read up on "Media Queries"

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
The only way to make those values variables would be to use javascript. Personally, I would use JQuery. With JQuery(or js), you can easily detect the screen size and orientation, and set the values as needed.
 
So jbenson001, I can embed that in my ASP.net? or?
I will start a new thread over there.


DougP
 
You would have to write a script, let's say using JQuery, that is run on the DOM load. It can determine the size of the screen. In there you can place logic based on dimensions on where to place the image. You can set CSS attributes easily from JQuery.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top