PDA

View Full Version : Tidying up some awesome BBcode


cowcowcow
05-03-2011, 06:45 AM
This BBCode is really awesome but i need some help tidying it up as i dont have any formal coding knowledge.
Basically it replicates a featured slider as shown here http://www.efectorelativo.net/laboratory/noobSlide/ - scroll down to Sample #5 - but with BBCode so you can customise the items that are featured each time.

Right now im using a total of 5 bbcodes but if some1 can show me how i will be able to shorten it to 2 or 3 i will be very grateful. This is how i currently do it. Its pretty dangerous that im leaving a script line open so i would like to know how i can close it properly.



BBCODEZOPEN

<script type="text/javascript" src="js/mootools-1.2-core.js"></script>
<script type="text/javascript" src="js/_class.noobSlide.packed.js"></script>
<script type="text/javascript">
window.addEvent('domready',function(){

//SAMPLE 5 (mode: vertical, using "onWalk" )
var info5 = $('info5').set('opacity',0.5);
var sampleObjectItems =[


BBCODEZLIST

{title:'Morbi elementum', autor:'Lorem', date:'5 Jun 2007', link:'http://www.link1.com'},
{title:'asdasd'},

BBCODEZCLOSE


];
var nS5 = new noobSlide({
mode: 'vertical',
box: $('box5'),
size: 180,
items: sampleObjectItems,
addButtons: {
previous: $('prev5'),
play: $('play5'),
stop: $('stop5'),
next: $('next5')
},
onWalk: function(currentItem){
info5.empty();
new Element('h4').set('html','<a href="'+currentItem.link+'">link</a>'+currentItem.title).inject(info5);
new Element('p').set('html','<b>Autor</b>: '+currentItem.autor+' &nbsp; &nbsp; <b>Date</b>: '+currentItem.date).inject(info5);
}
});

nS8.addActionButtons('previous',$$('#box8 .prev'));
nS8.addActionButtons('next',$$('#box8 .next'));
//more handle buttons
nS8.addHandleButtons(handles8_more);
//walk to item 3 witouth fx
nS8.walk(3,false,true);

});
</script>

BBCODEXOPEN

<center>
<span class="bigcatm">{param}</span>


<div class="sample">
<div class="mask2">
<div id="box5">
<span><img src="img1.jpg" alt="Photo" /></span>
<span><img src="img2.jpg" alt="Photo" /></span>


BBCODEXLIST

<span><img src="img1.jpg" alt="Photo" /></span>

BBCODEXCLOSE
</div>
<div id="info5" class="info"></div>
</div>
<p class="buttons">
<span id="prev5">&lt;&lt; Previous</span>
<span id="play5">Play &gt;</span>
<span id="stop5">Stop</span>
<span id="next5">Next &gt;&gt;</span>
</p>
</div>
</center>



So basically when i type in the BBCodes this way it comes out perfectly and customised. But yea its messy and theres problems running multiple replications of it on the same page.



CAPTION 1CAPTION 2nothing

nothing
IMG LOCATION 1
IMG LOCATION 2
nothing

kh99
05-03-2011, 02:47 PM
I was going to help you out but what you posted doesn't work for me.

BTW, were you planning to relase this as a mod?