Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8084049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:40:24+00:00 2026-06-05T17:40:24+00:00

I inserted one little jQuery code into my site, to fix the navigation icons

  • 0

I inserted one little jQuery code into my site, to fix the navigation icons left and right. The problem is that it only works when is resize the bowser window but it should put the icons right after the document is loaded… Here you can see this in action (hungarian language): utravalo.com

This code works on my other site and there is no problem. I’m a little bit confused… 🙂

This is the jquery code:

if (jQuery) {
  /* obtain jQuery instance */
  $sdv = jQuery.noConflict();

  /* ensure the links look & feel consistent */
  var formatLink = function (strEl) {
          var pEl = $sdv(strEl);
          if (pEl.length > 0) {
              pEl.children().children().css('color', '#3D536C');
              pEl.children().children().hover(

              function () {
                  $sdv(this).css('color', '#444444');
              }, function () {
                  $sdv(this).css('color', '#3D536C');
              });
          }
      }
  formatLink("#divPrev");
  formatLink("#divNext");

  var fnModifyNavigation = function () {
          /* obtain window's width */
          var w = $sdv(window).width();
          var hw = (w - 1020) / 2;
          if (hw > 100) {
              /* we have enough space for the fixed postion links */
              jQFPL($sdv("#divPrev"), 'left', 0, hw);
              jQFPL($sdv("#divNext"), 'right', 0, hw);
              $sdv("#divPostNav").hide();
          } else {
              /* not enough space for the fixed postion links */
              var divNav = $sdv("#divPostNav");
              if (divNav.length > 0) {
                  if (divNav.css('display') == 'none') {
                      divNav.show();
                      divNav.prepend(jQSPL("#divNext", "right"));
                      divNav.prepend(jQSPL("#divPrev", "left"));
                  }
              }
          }
      }

      /* jQuery Fixed Position Link */
  var jQFPL = function (el, remClass, absPosPX, width) {
          var pEl = el.detach();
          if (pEl) {
              pEl.removeClass(remClass);
              eval("var objStyle = { 'position':'fixed', 'top':'250px', 'width': '" + width + "px', '" + remClass + "':'" + absPosPX + "px', 'text-align':'" + remClass + "'};");
              pEl.css(objStyle);
              pEl.appendTo("body");
          }
      }

      /* jQuery Static Position Link*/
  var jQSPL = function (strEl, strFloat) {
          var el = $sdv(strEl).detach();
          el.css('position', 'static');
          el.css('width', '50%');
          el.css('float', strFloat);
          return el;
      }

      /* run position modification routine after the document is loaded */
      $sdv(fnModifyNavigation);

     /* handle the window's resize event and run position modification routine again */
     $sdv(window).resize(fnModifyNavigation);
}

Thanks for the help!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T17:40:25+00:00Added an answer on June 5, 2026 at 5:40 pm

    You want to run the modify nav, and formatLink function in the jQuery ready method (this waits for the html to load):

    $sdv(document).ready(
        function(){
    
            formatLink("#divPrev");
            formatLink("#divNext");
    
            /* run position modification routine
            after the document is loaded */
            $sdv(fnModifyNavigation);  
    
            /* handle the window's resize event
            and run position modification routine again */
            $sdv(window).resize(fnModifyNavigation);
        }
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a navigation-based iPhone-only app that serves two main purposes: One, to
First, a little background: We have an intranet site based on WSS 3.0 that
I'm running into a little trouble and I am hoping some one out there
I was wondering how could I remove one (wrongly inserted) entry/word from the ispell
I inserted the following code: $counter = 1; while($_POST['additional_contact1'] != '' || $_POST['additional_contact2'] !=
I inserted 'vanity_name' and 'name' into the first and second SELECT statements respectively. I
I have inserted string and integer values into dynamic columns in a Cassandra Column
I have this little jQuery plugin: <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd>
Can any one help me out how to export the jquery grid data to
I’m having a little trouble figuring this one out. I’m fairly new to C#,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.