image within anchor not following defined style

Using XMLHttpRequest() to configure entire ToolBook pages.

image within anchor not following defined style

Postby Andy » Mon Aug 10, 2020 10:59 am

Hi Clifford,
I am using xml to populate a text field. I want each paragraph of the text to start with an image, like an illuminated letter. A "float: left;" style does this. I also need the image to be clickable, but when I wrap it in an anchor it expands to take up the full width of the text field. Here is what I am using. What's wrong? Thanks for your help, Andy

<page>
<config delay="">
</config>

<wtext>
<htmlText>
<![CDATA[
<p><a href="#" id="first"><img src="../media/T.gif" alt="T" style="float: left;" /></a>
<span id="w1.1">he quick red fox...</span>
</p>
]]>
</htmlText>
</wtext>
<first>
<pgStyleObject>
{ theStyle : 'float',
propVals : 'left' }
</pgStyleObject>

<function name="myClick" event="click" params="e">
<![CDATA[
tbfunction_pgTBObjSet( "wtext", "user", 1);
]]>
</function>
</first>
</page>
Andy
 
Posts: 47
Joined: Tue Sep 09, 2014 3:40 pm

Re: image within anchor not following defined style

Postby Clifton » Mon Aug 10, 2020 5:46 pm

Here is an quick mockup I put together with seems to follow what you are trying to do. You can compare the source code with yours to see where you ran into problems.
Attachments
source_imageAnchor.zip
TBK XML Source (v11.5 but XML works in all versions)
(97.79 KiB) Downloaded 300 times
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: image within anchor not following defined style

Postby Andy » Tue Aug 11, 2020 8:51 am

I saw what I was missing and now it works perfectly. Thanks so much!
Andy
 
Posts: 47
Joined: Tue Sep 09, 2014 3:40 pm


Return to XML Configurations – Plugin Examples

Who is online

Users browsing this forum: No registered users and 1 guest

cron