HTML show different div according to user language [closed] - javascript

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I have a simple html page with div section. Div section contains several paragraphs <p>. I created separate div for every language. I want to show specific div corresponding to the user language.
I found that the language can be determined as follows
var language = window.navigator.userLanguage || window.navigator.language;
And div can be made visible as follows
document.getElementById(language).style.display="inline;"
However, for some reason, it doesn't work. I assume I don't understand something fundamental in page rendering process.
I will appreciate any help with this.

When modifying the style from JS you should not add any ';'.
try
document.getElementById(language).style.display="inline"
instead of
document.getElementById(language).style.display="inline;"

Related

How to make circular Scrollbar progress [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
https://portfolio-4bc43.web.app/
This is the link to my site. Check the circular scroll progress bar in the bottom right corner. I copied this element from https://filippoinzaghi.com/trophies/ It was working one day and the next day it stopped suddenly. I copied the element html, css and js all from that site. You can easily find the tags in my html and css files within scrollbar percent comments and js is also in the html file. Does anyone knows how to fix it?
Seems you forgot to add jQuery to your project

adjusting column width based on show/hide CSS [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I have 2 columns in a in a div row. The one on the left is my main content and the one on the right is chatroom. I want my users to be able to minimize and open the chatroom I know how to do this part. However when chatroom is Open i want my left column to be col-lg-10 and when chatroom is closed i want it to become col-lg-12. How can I acheive this?
Using jQuery (I see you use Bootstrap already) is quite straightforward:
$(".buttonToggleChat").on("click", function(){
$(".someSpecificClassColumn").toggleClass("col-lg-10 col-lg-12");
// ^^ the same selector you want to toggle 10/12 lg classes
});

is there away to get the path of HTML element [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I'm trying to change or remove errors from a HTML page I'm using firebug add in firefox and I have this part which I really don't where its writen :
is there a way to get the file where this is write .
thanks for any hint
Continuing from my comment: The highlighted element is dynamically added by a slider plugin e.g. like http://jqueryui.com/slider/ The clue is the classes like ui-slider-handler.
Look for the id="voltage" to find the place in the HTML where the div is and look for #voltage or ("voltage" or 'voltage') to see where the plugin is connect to it (in any jQuery or Javascript code).
I don't think you can get the exact path of the file, but check "View page source" option to see what files the page has been linked to.

Onclick copy to clipboard [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
Hey guys actually i'm trying to give my website users a possibility to click on a button and have some predefined text, in my case contact informations, to the clipboard.
These informations are already given in a div tag with the id="footer" and i want to fetch those or predefine them manually in syntax.
At the end of the page is a scissor, this is a after:element, this element ill change to a link or anything other so i can make it work.
Here's a link to the site
You can try this jquery plugin:
https://github.com/zeroclipboard/zeroclipboard
This makes it possible to copy text to youre clipboard with a button.

Use javascript to target element in php include [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
What's the best way to use javascript to target html elements included in an external php file?
I am adding/removing a class from my header whenever the client scrolls more than 20px from the top. The header is saved in header.php which is an included file in each page. This only works on html elements in the main pages. How do I target elements in the included files when sensing changes in distance from the main file?
Javascript works on the client. It sees only the final output from PHP and knows nothing about what mechanism PHP might have used to create it. Treat your header exactly as if it were part of the main document.

Categories