MaxRom | Scripturi uCoz Romania

Bannerul tau aici
[ Mesaje noi · Membrii · Regulamentul forumului · RSS ]
Pagina 1 din 11
Forum » uCoz system » Întrebări » Am nevoie de ajutor (cred ca js e de vina)
Am nevoie de ajutor
robertocorina97 Date: Miercuri, 2017-05-03, 15:32 | Message # 1
Mesaje: 7
Awards: 0
« 0 »

Salut, ma puteti ajuta sa inteleg si eu cum ar trebui sa pun aceste coduri pe site pentru a functiona?

Cod
<div class="question" id="question-1">
<h3>1. Razif is an entrepreneur with no set income every month. After establishing his business, he is planning to get a car loan to purchase a new car. With his income of at least RM5,000 a month, which car loan should he get?</h3>
<ul>
<li data-correct="1" data-answer="That’s correct! Although the interest rate of a variable rate car loan is commonly higher than a conventional loan, it offers Razif the freedom to reduce the interest by making extra payments toward his car loan. <a href='http://www.imoney.my/articles/car-loans-in-malaysia-conventional-vs-variable-rate'>See Car Loans in Malaysia – Conventional vs Variable Rate</a> for more information.
">
A. Variable Car Loan Rate
</li>
<li data-correct="0" data-answer="Not quite right. As Razif’s income is not fixed and may sometimes generate higher income through his business, a variable rate car loan offers this the opportunity to save on interest by paying more than the instalment. ">
B. Conventional Car Loan
</li>
</ul>
<div class="answer">
</div>
</div>

<div class="question" id="question-2">
<h3>2. Amy travels for business and leisure at least five times a year. Her father has been using his credit card to purchase air ticket and hotel rooms on her behalf. She is thinking of getting a credit card to make it more convenient to travel. Which of the following credit cards is the most suitable for her?</h3>
<ul>
<li data-correct="0" data-answer="Incorrect. As Amy is a frequent traveller, it makes sense for her to get a travel miles credit card to speed up the accumulation of loyalty points. Check our <a href='http://www.imoney.my/credit-card'>credit cards comparison</a> tool to find out which credit card is the most suitable for you.
">
A. Reward points credit card
</li>
<li data-correct="0" data-answer="Incorrect. As Amy is a frequent traveller, it makes sense for her to get a travel miles credit card to speed up the accumulation of loyalty points.
Check our <a href='http://www.imoney.my/credit-card'>credit cards comparison</a> tool to find out which credit card is the most suitable for you.
">
B. Cashback credit card
</li>
<li data-correct="1" data-answer="That’s correct! Travel miles credit cards are reward-based cards which allow you to earn points or AirMiles when used for purchases. Some travel credit cards also offer discounts on travel packages or flight tickets. Since Amy is a frequent traveller, it makes sense for her to get a travel miles credit card to speed up the accumulation of loyalty points.
Check our <a href='http://www.imoney.my/credit-card'>credit cards comparison</a> tool to find out which credit card is the most suitable for you.
">C. Travel Miles Credit Card</li>
</ul>
<div class="answer">

</div>
</div>

<div class="result">

</div>


Cod
body {
font-family: "helvetica Neue", sans-serif;
color: #333;
font-size: 14px;
}

.question {
ul {
list-style: none;
padding-left: 0;

li {
border-radius: 3px;
background: #e7ebed;
border: 1px solid darken(#e7ebed,10);
margin: 5px 0;
padding: 10px;

&:hover {
cursor: pointer;
background: darken(#e7ebed,3);
border-color: darken(#e7ebed,13);
}

&.correct {
background: #59b259;
border-color: #59b259;
color: white;

&:before {
content: '✔';
padding-right: 5px;
}
}

&.incorrect {
background: #da4f49;
border-color: #da4f49;
color: white;

&:before {
content: '✘';
padding-right: 5px;
}
}
}
}
}

.answer {display: none;}


Cod
var totalQuestions = $('.question').length;

$('.question').on('click','li',function(){
var id = $(this).parents('div').attr('id'),
answer = $(this).parent('ul').siblings('.answer'),
correctAnswer = 0;

if($(this).parents('#' + id).hasClass('answered')){
return false;
} else {
if($(this).data('correct') == '1'){
$('<p>' + $(this).data('answer') +'</p>').prependTo(answer);
$(this).addClass('correct');
correctAnswer++;
} else {
$('<p>' + $(this).data('answer') +'</p>').prependTo(answer);
$(this).addClass('incorrect').siblings('[data-correct="1"]').addClass('correct').siblings('[data-correct="0"]').addClass('incorrect');
}
$(this).parent().next('.answer').show().parent('div').addClass('answered');
}

});

 
Muşatinu Date: Miercuri, 2017-05-03, 15:44 | Message # 2
Mesaje: 1799
Awards: 202
« 52 »

robertocorina97, nici cea mai mică idee nu am, depinde ce reprezintă acest script. De unde l-ai luat și pentru ce?



 
robertocorina97 Date: Miercuri, 2017-05-03, 15:51 | Message # 3
Mesaje: 7
Awards: 0
« 0 »

e un script pentru quizz si eu presupun ca nu fac cv bine la js... cred ca nu e activat sau cv ... uite cum imi apare http://admitereonline.ucoz.ro/ e pe prima pagina ... ar trebui sa pot bifa casutele.. si e luat de aici http://codepen.io/jayhansim/pen/eawBG daca fac reclama imi cer scuze... pe prima pagina am bagat asa...
Cod
<script type="/js.js">
window.onload = function StartPM() {openLayerB('js.js',0,'/js.js','Mesaj Nou',335,300,1,0,0);}
</script>

<div class="question" id="question-1">
<h3>1. Razif is an entrepreneur with no set income every month. After establishing his business, he is planning to get a car loan to purchase a new car. With his income of at least RM5,000 a month, which car loan should he get?</h3>
<ul>
<li data-correct="1" data-answer="That’s correct! Although the interest rate of a variable rate car loan is commonly higher than a conventional loan, it offers Razif the freedom to reduce the interest by making extra payments toward his car loan. <a href='http://www.imoney.my/articles/car-loans-in-malaysia-conventional-vs-variable-rate'>See Car Loans in Malaysia – Conventional vs Variable Rate</a> for more information.
">
A. Variable Car Loan Rate
</li>
<li data-correct="0" data-answer="Not quite right. As Razif’s income is not fixed and may sometimes generate higher income through his business, a variable rate car loan offers this the opportunity to save on interest by paying more than the instalment. ">
B. Conventional Car Loan
</li>
</ul>
<div class="answer">
</div>
</div>

<div class="question" id="question-2">
<h3>2. Amy travels for business and leisure at least five times a year. Her father has been using his credit card to purchase air ticket and hotel rooms on her behalf. She is thinking of getting a credit card to make it more convenient to travel. Which of the following credit cards is the most suitable for her?</h3>
<ul>
<li data-correct="0" data-answer="Incorrect. As Amy is a frequent traveller, it makes sense for her to get a travel miles credit card to speed up the accumulation of loyalty points. Check our <a href='http://www.imoney.my/credit-card'>credit cards comparison</a> tool to find out which credit card is the most suitable for you.
">
A. Reward points credit card
</li>
<li data-correct="0" data-answer="Incorrect. As Amy is a frequent traveller, it makes sense for her to get a travel miles credit card to speed up the accumulation of loyalty points.
Check our <a href='http://www.imoney.my/credit-card'>credit cards comparison</a> tool to find out which credit card is the most suitable for you.
">
B. Cashback credit card
</li>
<li data-correct="1" data-answer="That’s correct! Travel miles credit cards are reward-based cards which allow you to earn points or AirMiles when used for purchases. Some travel credit cards also offer discounts on travel packages or flight tickets. Since Amy is a frequent traveller, it makes sense for her to get a travel miles credit card to speed up the accumulation of loyalty points.
Check our <a href='http://www.imoney.my/credit-card'>credit cards comparison</a> tool to find out which credit card is the most suitable for you.
">C. Travel Miles Credit Card</li>
</ul>
<div class="answer">

</div>
</div>

<div class="result">

</div>


si js l-am bagat in manager file cu numele js.js



Mesaj editat de
robertocorina97 - Miercuri, 2017-05-03, 15:52
 
Muşatinu Date: Luni, 2017-05-08, 07:42 | Message # 4
Mesaje: 1799
Awards: 202
« 52 »

robertocorina97,
1) la mine pe forum, fiecare cod îl pui în bbcodul special CODE nu în spoiler.
2)nu ai citit bine instrucțiunile:
stilurile CSS le pui în Style sheet (CSS) sau unde mai ții tu stilurile.
sau afișezi direct:
Cod
<style type="text/css">
stilurile css
</style>

Fii atent aici ștergi
Cod
body {
font-family: "helvetica Neue", sans-serif;
color: #333;
font-size: 14px;
}

el va veni în conflict cu stilul site-ului.
Codul HTML îl pui unde vrei să fie afișat, îndată sub el pui Codul js. LA ce ai scris tu am găsit 2 probleme:
Cod
<script type="/js.js">
window.onload = function StartPM() {openLayerB('js.js',0,'/js.js','Mesaj Nou',335,300,1,0,0);}
</script>

Asta e cererea de afișare a unei pagini pop-up, nimic comun cu js.
pentru a declara un cod js ai 2 variante
Cod
<script type="text/javascript">
codul js
</script>

sau
Cod
<script type="text/javascript" src="adresa fișierului js"></script>

la ce ai postat tu eu nu găsesc adresa http://admitereonline.ucoz.ro/js.js
Și codul final ar trebui să fie cam așa:

Cod

<style type="text/css">
.question ul {
  list-style: none;
  padding-left: 0;
}
.question ul li {
  border-radius: 3px;
  background: #e7ebed;
  border: 1px solid #cad3d7;
  margin: 5px 0;
  padding: 10px;
}
.question ul li:hover {
  cursor: pointer;
  background: #dee4e6;
  border-color: #c1cbd1;
}
.question ul li.correct {
  background: #59b259;
  border-color: #59b259;
  color: white;
}
.question ul li.correct:before {
  content: '✔';
  padding-right: 5px;
}
.question ul li.incorrect {
  background: #da4f49;
  border-color: #da4f49;
  color: white;
}
.question ul li.incorrect:before {
  content: '✘';
  padding-right: 5px;
}

.answer {
  display: none;
}
</style>

<div class="question" id="question-1">
  <h3>1. Razif is an entrepreneur with no set income every month. After establishing his business, he is planning to get a car loan to purchase a new car. With his income of at least RM5,000 a month, which car loan should he get?</h3>
  <ul>
    <li data-correct="1" data-answer="That’s correct! Although the interest rate of a variable rate car loan is commonly higher than a conventional loan, it offers Razif the freedom to reduce the interest by making extra payments toward his car loan. <a href='http://www.imoney.my/articles/car-loans-in-malaysia-conventional-vs-variable-rate'>See Car Loans in Malaysia – Conventional vs Variable Rate</a> for more information.
">
      A. Variable Car Loan Rate
    </li>
    <li data-correct="0" data-answer="Not quite right. As Razif’s income is not fixed and may sometimes generate higher income through his business, a variable rate car loan offers this the opportunity to save on interest by paying more than the instalment. ">
      B. Conventional Car Loan
    </li>
  </ul>
  <div class="answer">
  </div>
</div>

<div class="question" id="question-2">
  <h3>2. Amy travels for business and leisure at least five times a year. Her father has been using his credit card to purchase air ticket and hotel rooms on her behalf. She is thinking of getting a credit card to make it more convenient to travel. Which of the following credit cards is the most suitable for her?</h3>
  <ul>
    <li data-correct="0" data-answer="Incorrect. As Amy is a frequent traveller, it makes sense for her to get a travel miles credit card  to speed up the accumulation of loyalty points. Check our <a href='http://www.imoney.my/credit-card'>credit cards comparison</a> tool to find out which credit card is the most suitable for you.  
">
      A. Reward points credit card
    </li>
    <li data-correct="0" data-answer="Incorrect. As Amy is a frequent traveller, it makes sense for her to get a travel miles credit card  to speed up the accumulation of loyalty points.
                    Check our <a href='http://www.imoney.my/credit-card'>credit cards comparison</a> tool to find out which credit card is the most suitable for you.  
">
      B. Cashback credit card
    </li>
    <li data-correct="1" data-answer="That’s correct! Travel miles credit cards are reward-based cards which allow you to earn points or AirMiles when used for purchases. Some travel credit cards also offer discounts on travel packages or flight tickets. Since Amy is a frequent traveller, it makes sense for her to get a travel miles credit card  to speed up the accumulation of loyalty points.
                    Check our <a href='http://www.imoney.my/credit-card'>credit cards comparison</a> tool to find out which credit card is the most suitable for you.  
">C. Travel Miles Credit Card</li>
  </ul>
  <div class="answer">
    
  </div>
</div>

<div class="result">
  
</div>

<script type="text/javascript">
var totalQuestions = $('.question').length;

$('.question').on('click','li',function(){
  var id = $(this).parents('div').attr('id'),
      answer = $(this).parent('ul').siblings('.answer'),
      correctAnswer = 0;
  
  if($(this).parents('#' + id).hasClass('answered')){
    return false;
  } else {
    if($(this).data('correct') == '1'){
      $('<p>' + $(this).data('answer') +'</p>').prependTo(answer);
      $(this).addClass('correct');
      correctAnswer++;
    } else {
      $('<p>' + $(this).data('answer') +'</p>').prependTo(answer);
      $(this).addClass('incorrect').siblings('[data-correct="1"]').addClass('correct').siblings('[data-correct="0"]').addClass('incorrect');
    }
    $(this).parent().next('.answer').show().parent('div').addClass('answered');
  }
  
});
</script>


exemplu: http://maxrom.ucoz.com/index/0-9



 
robertocorina97 Date: Luni, 2017-05-08, 16:20 | Message # 5
Mesaje: 7
Awards: 0
« 0 »

Mersi mult, am reusit sa-i dau de cap... :)

 
Forum » uCoz system » Întrebări » Am nevoie de ajutor (cred ca js e de vina)
Pagina 1 din 11
Căutare: