Solved

Rollover image (toggle) causes page shift

Posted on 2012-04-11
14
327 Views
Last Modified: 2012-06-04
I have an issue that I cannot figure out how to resolve.

I have a toggle on my site that I use to flip between different versions of similar products.
There are many. visit sbravo daht com and navigate to... UDC > 7000 split. See the weak little toggle? (I'd love to upgrade this things graphics).

Every time it is clicked, the page snaps its top edge to the centerline of the toggle. When you click it again to switch back... the page snaps even lower to align with the top of my key features tab area.

What the heck?!   I have seen this in IE and FF, both latest v. I have inspected this element and poked around the style.css where it appears some attributes for this thing are found. I'm not sure if there might also be something in the function.php to control this?

GOAL: I want it to stay PUT when clicked, and stop snapping the page up and down when loading the alternate page.

My most sincere thanks in advance. Also, If you can peel my site like an onion, I might have some work for you.
0
Comment
Question by:TimberJon
  • 6
  • 3
  • 3
  • +1
14 Comments
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 37835473
I think you need to get rid of the
href="#options"

Open in new window

(and events in the other state) in the <a> tag around the image because:

1) there is no <a name="options">
2) you change the url afterwards (in the onclick) so it seems useless to me

Try this:
href="javascript:void(0)"

Open in new window


However, the navigation action in itself may still cause a 'jump'.
0
 

Author Comment

by:TimberJon
ID: 37838683
Thanks for the info. I cannot find where this line exists except in the source code, but it looks like this is a trigger #events for the one page, and #options for the other, with each linking back and forth to each other.

I don't think this is related to a button that loads another page. Are these #attributes just bundling a script for both the swapout of the toggle image and linking to the other page?

I need to find where to edit this button/toggle's properties, like where it is linking to. I have tried a Find for #events and #options on every css I know but can only find one reference in the primary style sheet that just lists 28px which is probably just it's position since the page snaps much farther than 28px each click. Would they be found in any php files?
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 37843572
> Would they be found in any php files?

Yes, if it's not in your own sources than it could be generated in server side code like php. Any chance you could post that?

Maybe there's a call to a function in an included file which generates that block of html and could be influenced with parameters?
0
 

Author Comment

by:TimberJon
ID: 37843806
I will dig through the php's and see if I can find any reference to these. I will post whatever pops up.

The thing that bugs me is that I'm so used to opening the htm or html file and digging through the code. Bingo! I find everything I need. With wordpress... there doesn't seem to be any physical pages, everything is calling on everything else. And with a custom site this complex, some of my pages AND posts are all blank, with their content being controlled by who knows how many other files.

Reading through all the material at w3schools is helping a bit, but only a bit. My css and php kung fu is about 4 days old.
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 37844070
Ah, I must admit I hadn't 'peeled' far enough to discover it was a Wordpress site, you hadn't mentioned it in your question. I haven't worked with that before but have worked with a number of CMS applications and it's usually possible to hide code in templates which sounds like what you're describing: a 'blank' page can only mean that the actual content is being generated elsewhere.

Can you describe in more detail how this page is defined, maybe provide a screendump?
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 37847628
I shudder a little when I see javascript:void and w3schools (go to w3fools.com to see why)
I also shudder when I see Wordpress because it has so far been ridiculously hard to find anything in Wordpress.

That said, I'll fire up firebug and see what the CSS says. It will have to wait till after breakfast and as already said, it is possible we will find the culprit in the view source but not in the wp sources
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
ID: 37847705
Change
<a onclick="window.location="http://sbravo.com/udc-sump/b-7000-split"" href="#options">
<img alt="" src="http://sbravo.com/wp-content/themes/bravo/images/right_slideshow_btn.png">
</a>
to

<a onclick="window.location="http://sbravo.com/udc-sump/b-7000-split; return false"
href="#options">
<img alt="" src="http://sbravo.com/wp-content/themes/bravo/images/right_slideshow_btn.png">
</a>

or better

<a href="http://sbravo.com/udc-sump/b-7000-split">
<img alt="" src="http://sbravo.com/wp-content/themes/bravo/images/right_slideshow_btn.png">
</a>

There is no reason for javascript at all

The reason you jump is because ID="options" is defined

<div id="options" class="ui-tabs-panel ui-widget-content ui-corner-bottom clearfix ">
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 37848199
@Michel:
shudder when I see Wordpress
I could not agree more.  It's the perfect tool if you want to do only Wordpress things, like write an occasional blog entry.  Once you try to extend its functionality to build a web application you're in a morass!

No points for my rant, please.  Best to all, ~Ray
0
 

Author Comment

by:TimberJon
ID: 37851807
Thank you all. w3fools is great, thank you for that. I will definitely dig up the resources listed there.

I see this code in the page source, but cannot find it anywhere.. I am finding for "onclick" in all php and css documents I can find in my custom theme dir.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 37852017
So it must be in a plugin somewhere
0
 

Author Comment

by:TimberJon
ID: 37899235
Still waiting to test this codefix out. Threads not dead yet.
0
 

Author Comment

by:TimberJon
ID: 38045351
My dev fixed it, but I supplied them the above code. Since they were probably scratching their heads, I am betting my money that mplugjan's suggestion did the trick.

THANKS!
0
 

Author Closing Comment

by:TimberJon
ID: 38045356
Clear and concise cause and provided codefix. Thanks a ton.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now