Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to make "intro" page where you can choose two different colors for the template.
My question is: is there a way to do this without creating new .html files with changed style?
is there a way, where you can change with click and that to lead you to index.html? (also, if this is possible, how to apply this to all .html documents)
Thanks!
Yes, just select the link and change its href:
$('link[rel=stylesheet]').attr('href', 'my-other-sheet.css');
If you have multiple stylesheet include tags, you'll need to select by some other criteria like id.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
In my webpage i have created a little div that contains an external site. My code looks like this:
var divPrev = createElement('div', 'divPrev', 'divPrevcss');
var objSf = createElement('object', 'objSf', 'objSfcss');
objSf.setAttribute('type','text/html');
objSf.setAttribute('data','http://'+oStxt.value);
divPrev.appendChild(objSf);
divMain.appendChild(divPrev);
I use this like a preview and it works with most of the websites, but with some, when the site loads into my div, after a few seconds it loads the site instead of my page, as if redirecting the browser.
An example is if I show into my div http://www.salomon.com.
How is possible prevent this type of behavior?
You can use an <IFRAME> to embed an other HTML document into your webpage. It has full cross-browser support.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
how to create elements in javascript with href=variable?
how to create this with javascript when you click a button?
every time you hit the button, another div will appear.
<div></div>
thanks
Don't know exactly what you want, but you can create an a element with href=variable like this :
var a = document.createElement('a');
a.href = "http://google.fr";
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Is there a way to completely swap out a HTML table for a different one using javascript?
I know I can change the content in an existing table but can I have a pre-made table and just swap it in in place of a current table? and if so, how would I go about doing that?
If you already have the two tables in that screen you can simply make one of them invisible using CSS style="display:none" and use javascript to access them and switch the display attribute between them each time you want to swap.
javascript code to switch would be
document.getElementById("elementID").style.display=''; (to show)
document.getElementById("elementID#2").style.display='none'; (to hide)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to use multiple details tags on a page. However, some may end up containing a lot of content and for that reason I want to limit only one being open at any given time. This naturally means closing one if it's already open.
Is it possible to close a detail tag programmatically using JavaScript?
If I understand you correctly, this should do what you want (jsfiddle). The details element has an open attribute that you can simply remove. I am using jQuery, but it should be straightforward to do the same in vanilla JS.
$(document).ready(function() {
$('details').on('click', function() {
$('details').removeAttr('open');
});
});
You might want to filter out the details tag that the click event was triggered on, but it seems to work this way.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have this gallery that does not support multiple albums on the same page and I need help to hide the images of the second album that I created. How can I hide the four images below the images with the text?
I duplicated the JS file, button ID, so I can see multiple albums on the same page, I don't understand what I'm missing here.
http://www.piterpan.it/ppgallery/giugno.html
Use can use display property of CSS;
<img src="yourWebsiteAddress/ppgallery/img/13-03-17/aperitour-marzo-01_tb.jpg"
style="display: none;">
Or you can use jQuery selectors;
$("#gallery").hide();
$("#view2").hide();
For convenience you can define a class for those you want to hide and simply
$(".hiddenClass").hide();