Jump to content

j.silver

Members
  • Posts

    142
  • Joined

  • Last visited

Everything posted by j.silver

  1. The above explains what happens when I keep just one jQuery link. Not only it is not solving the first problem, it additionally creates a problem of having the language links (drop down menu) disappearing completely.
  2. Many thanks, justomeguy, for your clarification which is informative. For your advice on placing css link in the header, it is there while links to js/jQuery are at the bottom of the body tag. The problem is still there. This might have to do with the slowness of the jQuery you addressed in a previous response. Is there anything else I can do?
  3. I have commented out the second link pertaining to the language list, leaving the first link and both links to the js files, it has resulted in a total disappearance of the language links while the bottom anchor link continued to have no text.
  4. Hi, For all pages, there is a language link in the header that is created with the help of a jQuery link. For only one page, however, there is another jQuery link (besides the first jQuery) to make a text collapsible/uncollapsible. I placed both links along with their associated js files before the closing body tag. All pages are fine, except the one having the two jQuery links--it has resulted in the disappearance of a text of another anchor link in the header not related to any function of the jQueries. It seems that the jQuery affecting the language link (anchor) is also affecting the other anchor of the header. How to make the second jQuery link not affect the other anchor link? Links are listed below. <script type= "text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"></script> <script type= "text/javascript" src= "./js/collabsible.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script> <script src="js/languageswitcher.js"></script>
  5. Now I got it right and thanks all for the help. I need some help in tuning two minor issues in the header: My header consists of a video occupying 60% of the total width; 40% is taken by an aside that has three elements, from top to bottom: language list, h1 text, and a bottom link. Prior to introducing the language list, the bottom link had been perfectly taking the full 40% width. Upon introduction of the language list, however, a small gap of approximately 1px has appeared to the right of the bottom link. This has happened only because of the language link since no other changes in the css or html is made. Why do you think this has happened and how to fix it? In loading the page, there is a split-of-a-second time lag between the html of the language list and its css formatting. How can I delay the html of the language list portion to make it load along with the css formatting?
  6. It works fine when all files are in the same folder. I need help in properly referring to the image file because I have just started learning js/jQuery.
  7. When everything is in the same folder, it works perfectly. My folder set up is: main folder with index.php and two other folders (js & images). I placed the flags inside the images folder and the js file inside the js folder. I managed to include the js file but not the flags--I don't know how to do that within the js script (above).
  8. The complete html and jQuery is below and the flags file is attached. The drop down menu should list a flag against corresponding language: <div id="country-select"> <form action="server-side-script.php"> <select id="country-options" name="country-options"> <option selected="selected" title="http://www.yoursite.com" value="us">English</option> <option title="http://www.yoursite.nl" value="uk">UK</option> <option title="http://www.yoursite.fr" value="fr">Français</option> <option title="http://www.yoursite.de" value="de">Deutsche</option> <option title="http://www.yoursite.nl" value="nl">Nederlandse</option> </select> <input value="Select" type="submit" /> </form> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script> <script src="languageswitcher.js"></script> $(document).ready(function() { // --- language dropdown --- // // turn select into dl createDropDown(); var $dropTrigger = $(".dropdown dt a"); var $languageList = $(".dropdown dd ul"); // open and close list when button is clicked $dropTrigger.toggle(function() { $languageList.slideDown(200); $dropTrigger.addClass("active"); }, function() { $languageList.slideUp(200); $(this).removeAttr("class"); }); // close list when anywhere else on the screen is clicked $(document).bind('click', function(e) { var $clicked = $(e.target); if (! $clicked.parents().hasClass("dropdown")) $languageList.slideUp(200); $dropTrigger.removeAttr("class"); }); // when a language is clicked, make the selection and then hide the list $(".dropdown dd ul li a").click(function() { var clickedValue = $(this).parent().attr("class"); var clickedTitle = $(this).find("em").html(); $("#target dt").removeClass().addClass(clickedValue); $("#target dt em").html(clickedTitle); $languageList.hide(); $dropTrigger.removeAttr("class"); }); }); // actual function to transform select to definition list function createDropDown(){ var $form = $("div#country-select form"); $form.hide(); var source = $("#country-options"); source.removeAttr("autocomplete"); var selected = source.find("option:selected"); var options = $("option", source); $("#country-select").append('<dl id="target" class="dropdown"></dl>') $("#target").append('<dt class="' + selected.val() + '"><a href="#"><span class="flag"></span><em>' + selected.text() + '</em></a></dt>') $("#target").append('<dd><ul></ul></dd>') options.each(function(){ $("#target dd ul").append('<li class="' + $(this).val() + '"><a href="' + $(this).attr("title") + '"><span class="flag"></span><em>' + $(this).text() + '</em></a></li>'); }); }
  9. Hi, I have the below jQuery script that should list relevant country flag before the name of flag's country. The flags are named "flags", and are of PNG format. Everything is working fine, except flags are missing. I would appreciate showing me what to change in the code to make the flags appear. function createDropDown(){ var $form = $("div#country-select form"); $form.hide(); var source = $("#country-options"); source.removeAttr("autocomplete"); var selected = source.find("option:selected"); var options = $("option", source); $("#country-select").append('<dl id="target" class="dropdown"></dl>') $("#target").append('<dt class="' + selected.val() + '"><a href="#"><span class="flag"></span><em>' + selected.text() + '</em></a></dt>') $("#target").append('<dd><ul></ul></dd>') options.each(function(){ $("#target dd ul").append('<li class="' + $(this).val() + '"><a href="' + $(this).attr("title") + '"><span class="flag"></span><em>' + $(this).text() + '</em></a></li>'); }); }
  10. Hi, In a responsive website, programmers usually consider three screen sizes: normal, tablets, and cell phones. When the browser reaches each size, there usually be no overlapping, however, in sizes between those three there is overlapping of content. I would appreciate if someone can explain how to prevent overlapping in between the three sizes?
  11. May thanks. I restarted the laptop, refreshed everything, and it is working now.
  12. Hi. I attempted to load a couple of PHP pages, one of which is the index page, but the message I got is below. The index page is also open in another tab; when refreshed it runs perfectly, but loading it afresh is deniable. Both Apache and MySQL are running; I turned them off and on again and ensured that skype is also off and no firewall set up is changed or updated. I would appreciate if someone could advise what could be the problem and what is the solution? Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. If you think this is a server error, please contact the webmaster. Error 404 localhostApache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9
  13. What is the best way of capturing data sent via a contact-us form (I am using form and PHP)--in DB only, in a dedicated email only, or in both? Pros and cons of each method please, if possible.
  14. I have to use the autoplay attribute. Is there another method?
  15. So this means I have to make one extra footer page to have the scripts placed before the closing body tag?
  16. <php at the top of page> <followed by an html tags, then by below php> <?php include ('./includes/footer.html'); ?> <script type= "text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"></script> <script type= "text/javascript" src= "./js/collabsible.js"></script> For one odd page of the website I wanted to have collapsible/uncollapsible text using jQuery, so I placed the relevant scripts at the bottom of the page as seen above. It works. But in a previous communication it was stated that the ideal place for inclusion of js/jQuery scripts is before the closing tag of the body. The footer file, included before the scripts, closes the body and html tags, which means the scripts are placed even after the closed html. If scripts are placed before inclosure of the footer file, it would then be before some html tags. I cannot place them in the footer file before closure of the body tag because I need scripts in this page only while footer is also in the rest of site pages. It seems I have only two options: leaving them as seen above or make one additional footer page for this page only where I can place the scripts before body closure tag. Any help or guidance will be appreciated.
  17. I want to give users a choice of unblocking my video and seeing it, but I never come across something like that before. Can someone kindly share a sample code for doing that?
  18. What do you mean by providing a choice--an alternative to the video (e.g. image, text, etc.) or unblocking the video?
  19. I have a page that links to a video. When it loads, there is a lag in video loading, meaning the video loads but after a few seconds from loading the rest of content. I would appreciate if someone can show me how I can make the video loads exactly at the same time of everything else.
  20. When you state 'native code' in this subject, I presume you refer to js code. Is it so? You also brought an interesting subject about jQuery being slower than js, contrary to my assumption, which proves that one has to be careful about some information here and there in some tutorials. Do browsers give way to testing the speed of jQuery code against a similar code in js?
  21. While jQuery is not a scripting language alternative to js, it does much of js' functionality without the complication associated with js programming. What are and where can I find a list of functionalities not yet doable by jQuery, but only by js?
  22. Many thanks justomeguy. How would I know which browsers don't have such emulation capability, and how to test against them?
  23. Dear all: I would appreciate if one can explain how I can practically test what my website will look like in a cell phone or tablet prior to launching it.
  24. Thanks, Ingolme. Is there a good and practical method of testing the feature that I want to use in old browsers and in cell phones and tablets? I mean a method other than downloading each and every old browser version for testing
  25. Dear all: I have just started learning js and jQuery. I am confused about browser support to js. On one hand, there seems to be a general agreement that js is the most popular language for website design. On the other hand, It's stated that js is not equally supported by browsers, especially old browsers, and that some user browsers might even turn down js. jQuery is a better alternative for browser support. Is this true about problems in js' browser support? And if it is, how could a language with such a draw back become the most popular?
×
×
  • Create New...