|
|
| Строка 1: |
Строка 1: |
| $(function () {
| | console.log('Привет'); |
| $('.chem-recipe').each(function () {
| |
| var recipeBox = $(this);
| |
| | |
| var name = recipeBox.find('.chem-name').text();
| |
| var recipe = recipeBox.find('.chem-recipe-body').html();
| |
| var effects = recipeBox.find('.chem-effects').html();
| |
| var description = recipeBox.find('.chem-description').html();
| |
| | |
| var html = '<div style="border:1px solid #aaa; border-radius:8px; padding:10px; margin:10px 0; background:#f9f9f9;">';
| |
| | |
| html += '<div style="font-weight:bold; font-size:1.2em; margin-bottom:6px;">' + name + '</div>';
| |
| | |
| if (recipe) {
| |
| html += '<div style="margin-bottom:5px;"><b>Рецепт:</b><br>' + recipe + '</div>';
| |
| }
| |
| | |
| if (effects) {
| |
| html += '<div style="margin-bottom:5px;"><b>Эффекты:</b><br>' + effects + '</div>';
| |
| }
| |
| | |
| if (description) {
| |
| html += '<div style="color:#555;"><em>' + description + '</em></div>';
| |
| }
| |
| | |
| html += '</div>';
| |
| | |
| recipeBox.replaceWith(html);
| |
| });
| |
| });
| |